4

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?

MDev
  • 127
  • 9

1 Answers1

10

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.

Daniel Grim
  • 2,261
  • 19
  • 22
  • just adding-up, since using a client like WinSCP doesn't work quite nicely due to the one-time password... to download from command line you can use sftp like this `ex: sftp -oPort=2222 "cf:a8e2d87f-3f1e-4ef5-80cd-342s1ae37a79/0"@ssh.ng.bluemix.net:/home/vcap/app/filename /tmp/filename` ` – silveiralexf Dec 25 '18 at 22:04