How to copy files from Liberty on Bluemix to Windows?

孤街醉人 提交于 2019-12-01 20:16:34

问题


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.

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.

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

thoughts/ideas?


回答1:


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.

  1. get the app guid from the command (where <app_name> represents the name of your app): cf app <app_name> --guid
  2. get a one-time ssh code: cf ssh-code

Next, find the appropriate endpoint for your Bluemix region:

  1. ssh.ng.bluemix.net:2222 for US South
  2. ssh.eu-gb.bluemix.net:2222 for United Kingdom
  3. ssh.au-syd.bluemix.net:2222 for Sydney

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.

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.



来源:https://stackoverflow.com/questions/41858496/how-to-copy-files-from-liberty-on-bluemix-to-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!