OK man. I had same trouble. The most simple way is SCP over SSH.
To turn this more simple as i can, i put the follow steps.
After all
I supose that you already had the "Cf cli" installed on your enviroment.
See how in: https://docs.cloudfoundry.org/cf-cli/install-go-cli.html
Now to login in Cloud foundry SSH we have some things to do:
- Enable the ssh in you IBM app
- Get the SSH host
- Get the user
- Get password
Step 01 - Enable SSH
See official references in: https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html
Open CMD or terminal write:
> cf login - it's goes like bla bla bla
> cf enable-ssh app-name
You realy want know the app name! It's basics...
Step 2 - Get the server host
Well... if i have to explain what is a ssh host, is better rollback from here. If not, run command (little joke):
cf curl /v2/info
"app_ssh_endpoint": "ssh.MY-DOMAIN.com:2222"
Result is a json with many attributes.
Copy the field called "app_ssh_endpoint".
Take a look that after ":" is the ssh port to fill in the Winscp form or terminal command.
Step 3 - Concatenate you username
The username has made of "cf:" + "GUID" + "/" + "InstanceID".
To get GUID run terminal command:
cf app MY-AWESOME-APP --guid
Return a long id like: abcdefab-1234-5678-abcd-1234abcd1234
The instance ID is the sequential number of you app instance. The first app instance becomes with "0".
So we have cf:my-guid-result/0 as user name.
Step 4 - Get temp password
This step retrive a single use pass. Is this! You only use once the pass. Buuuut... you can execute this command every time that you would connect to the server or execute commands.
To get pass run terminal command:
cf ssh-code
Return small password: abcdefab
After this i recomend:
If you desire to download a whole "app/" folder like me, compact this and download with winSCP graph interface or by terminal using "scp" command.
This isn't intuitive but it's possible to do. I wish you a good luck.