Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy files from Liberty on Bluemix to Windows?

Tags:

ssh

ibm-cloud

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?

like image 415
MDev Avatar asked Dec 23 '22 21:12

MDev


1 Answers

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.

like image 108
Daniel Grim Avatar answered Jan 13 '23 14:01

Daniel Grim