Cloud Foundry SSH

398 Views Asked by At

I want to access my app pushed on Cloud Foundry with a GUI interface like Filezilla or any other. Is there any way to see what files i have pushed and to push a single file on cloud foundry rather then using CLI ssh?

1

There are 1 best solutions below

0
On

The primary way to access your application over SSH is with cf ssh, but that is just a convenient way to do it. You can use ssh or scp or sftp or any other tool that supports those, like Filezilla.

Instructions:

  1. You need the host for your environment. This tells your client where to connect. It's the same endpoint for all apps (it's a proxy). To fetch it, run cf curl / | jq -r .links.app_ssh.href.

  2. You need the username for your app. This is unique to your app and takes the format cf:<app-guid>. To fetch your app guid, run cf app <name> --guid.

  3. You need the app instance number. If you only have one instance of your app, then use 0. If you have multiple app instances, you can pick which one by setting the zero-based app instance number.

  4. You need a passcode. This is a temporary password that works one time and only for a short period of time. To fetch it run, cf ssh-code & copy the output.

You now have everything you need to plug that into your client:

  1. For ssh: ssh -p 2222 cf:<guid>/<app-instance>@<endpoint>, when prompted enter the passcode. Ex: ssh -p 2222 cf:162fd89b-2ff3-46cf-8d00-f58659d8b4a1/[email protected].

  2. For scp: scp -P 2222 -oUser=cf:<guid>/<app-instance> <local-file> <endpoint>:remote-file. Ex: scp -P 2222 -oUser=cf:162fd89b-2ff3-46cf-8d00-f58659d8b4a1/0 my-local-file.json ssh.example.com:my-remote-file.json.

  3. For sftp: sftp -P 2222 cf:<guid>/<app-instance>@<endpoint>. Ex: sftp -P 2222 cf:162fd89b-2ff3-46cf-8d00-f58659d8b4a1/[email protected].

Reference doc: https://github.com/cloudfoundry/diego-ssh#cloud-foundry-via-cloud-controller-and-uaa