我的客户端如何针对IBM Bluemix CloudFoundry应用程序

时间:2017-01-11 17:54:23

标签: ssh ibm-cloud sftp scp diego

我有兴趣使用 ssh scp sftp 等客户端工具与我的IBM Bluemix CloudFoundry App进行交互。

  

具体来说,我的应用程序Web安装程序创建了一个动态生成的文件/文件夹,我想将其本地下载到我的笔记本电脑。

我已经了解了最近的Diego支持,我对利用所讨论的diego-ssh代理身份验证功能here感兴趣。

1 个答案:

答案 0 :(得分:0)

使用Cloud Foundry cf command line interface并按照发现here的diego-ssh指南,您可以按如下方式完成客户端代理身份验证:


    $ cf ssh-code | pbcopy # paste authorization code when prompted for password

然后,可以将此授权代码用作密码来调用以下命令:


    # Direct SSH Client Interaction
    $ ssh -p 2222 cf:$(cf app your_bluemix_app_name --guid)/0@api.ng.bluemix.net

    # Secure Copy
    $ scp -P 2222 -oUser=cf:$(cf app your_bluemix_app_name --guid)/0 my-local-file.json api.ng.bluemix.net:my-remote-file.json

    # Secure FTP Transfer (GET, PUT, ...)
    $ sftp -P 2222 cf:$(cf app your_bluemix_app_name --guid)/0@api.ng.bluemix.net

Bluemix的关键细节是了解其CF API端点:

地区名称 CF API端点
美国南部地区 api.ng.bluemix.net
英国地区 api.eu-gb.bluemix.net
悉尼地区 api.au-syd.bluemix.net

通过这些客户端的某些组合,您可以在本地和Bluemix CF App环境之间无缝移动文件,以满足各种最终用户开发需求。

以下是一个示例互动:


    $ sftp -P 2222 cf:$(cf app goldi --guid)/0@api.ng.bluemix.net
    The authenticity of host '[api.ng.bluemix.net]:2222 ([158.85.156.18]:2222)' can't be established.
    RSA key fingerprint is SHA256:ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx8.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '[api.ng.bluemix.net]:2222,[158.85.156.18]:2222' (RSA) to the list of known hosts.
    cf:59xxxxx3-4xxa-4xxx-xxxe-x0x@api.ng.bluemix.net's password:
    Connected to api.ng.bluemix.net.
    sftp>