如何将文件从Bluemix上的Liberty复制到Windows? [英] How to copy files from Liberty on Bluemix to Windows?
问题描述
我正在使用Windows7,具有cf设置,我的应用程序已迁移到Diego,可以ssh进入我的应用程序(cf ssh APPNAME).我可以在ssh中运行scp,但是我不知道要使用什么选项.
I'm using Windows7, I have cf setup, my app has been migrated to Diego and I can ssh into my app (cf ssh APPNAME). I can run scp within my ssh but I don't know what options to use.
据我所知,scp希望目标计算机正在运行ssh.因此,如果我是从Linux机器连接到Bluemix的,那么目标将是我的本地机器和具有ssh访问权限的用户.由于我正在运行Windows,因此默认情况下不可用.
From what I can tell, scp expects the target machine to have ssh running. So if I was connnected to Bluemix from a Linux box, the target would be my local box and a user that had ssh access. Since I'm running windows, that's not available by default.
如果所有这些都是真的,那么我想我有几个选择: -改用Linux -将ssh安装到Windows中 -可能使用诸如winscp之类的东西,但是我不确定bluemix是否只能通过'cf ssh'命令访问
If all of that is true, then I think I have a few options: - use Linux instead - install ssh into windows - possibly use something like winscp but I'm not sure if bluemix can only be accessed via the 'cf ssh' command
想法/想法?
推荐答案
您应该能够使用WinSCP之类的文件来传输文件.首先,您需要使用CF CLI进行一些操作.
You should be able to use something like WinSCP to transfer files. You'll need to get a few things using the CF CLI first.
- 从命令中获取应用程序guid(其中
<app_name>
代表应用程序的名称):cf app <app_name> --guid
- 获取一次性的ssh代码:
cf ssh-code
- get the app guid from the command (where
<app_name>
represents the name of your app):cf app <app_name> --guid
- get a one-time ssh code:
cf ssh-code
下一步,找到适合您的Bluemix区域的端点:
Next, find the appropriate endpoint for your Bluemix region:
- ssh.ng.bluemix.net:2222(美国南部)
- ssh.eu-gb.bluemix.net:2222 for United Kingdom
- ssh.au-syd.bluemix.net:2222 for Sydney
在WinSCP(或类似工具)中,使用SCP文件协议,将用户名设置为cf:<guid>/<app_instance>
,其中<guid>
是上述命令的guid,<app_instance>
是您的应用的实例号(如果您的应用为0,只有一个实例).根据上面为您的Bluemix区域显示的主机/端口设置主机/端口,并使用cf ssh-code
命令将密码设置为ssh代码.
In WinSCP (or similar tool), use SCP file protocol, set the username to cf:<guid>/<app_instance>
where <guid>
is the guid from the above commands and <app_instance>
is the instance number of your app (0 if your app only has one instance). Set the host/port according to the host/port shown above for your Bluemix region, and set the password to your ssh-code from the cf ssh-code
command.
然后您就可以登录了,记住ssh代码是一次性的,因此每次连接时都需要重新生成该部分.
You will then be able to login, remember that the ssh-code is one-time use so you'll need to regenerate that part every time you connect.
这篇关于如何将文件从Bluemix上的Liberty复制到Windows?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!