Are you wondering what the devil is going on at other end after your CF PUSH? In my case, my app had a feature where files were stored on the server, and I wanted to take a look under the bonnit to see if it was doing the right thing. I still haven’t found a good way of doing this using the cockpit, therefore SSH could be a good option here.

As a sworn Windows user, I wanted to use PuTTY. You might have other SSH clients as your first choice – and my guess is that they work in the same manner and that you can reuse some of the steps below.

SSH your SAP Cloud Platform CF app

 

Short disclaimer: If you don’t know SSH you should consider stopping here. You can mess things up there, even without admin/sudo rights. Be warned.

The following walk-through will get you connected to your SAP Cloud Platform Cloud Foundry tenant. It assumes that you are familiar with deploying apps to the Cloud Foundry environment, and that you have the Cloud Foundry Command Line Interface (CLI) and PuTTY installed.

You should be logged on to your endpoint in a command line window and have your application deployed before you follow this approach.

 

  1. In your command line window, query your endpoint to get the correct domain name and port by using the following command.
    cf curl /v2/info​

     

  2. Note the ssh endpoint and port: SSH your SAP Cloud Platform CF app
  3. Then you want to get the guid of your application, this you get by running the following command:
    cf app [name of your app] --guid​

     

  4. Note your guid, it will look something like this: SSH your SAP Cloud Platform CF app
  5. Next thing, you need to generate a onetime authorization code for SSH. Run the command
    cf ssh-code​

     

  6. Take a note of it, but remember that it could only be used once. It should look something like this:
    SSH your SAP Cloud Platform CF app
  7. Now it’s time to put it all to work. The structure you are looking for to start PuTTY is the following:
    putty -ssh -P [port] [app guid]/[domain endpoint]

     

  8. In my case, it looks like this:
    SSH your SAP Cloud Platform CF app
  9. This will open a nice PuTTY SSH window for you:
    SSH your SAP Cloud Platform CF app
  10. This is where you enter the authorization code from step 6. Case sensitive. No echo – so do it correctly. If you get an “Access denied”, run step 6 again. The reward is sweet: SSH your SAP Cloud Platform CF app

 

That’s it. Now, you can for instance check chmod, look at the files in your app (you will find that under the /app folder up top) or other useful stuff.

SSH your SAP Cloud Platform CF app

I’m not pretending to be a Linux guru, so my only advice is to be careful with what commands you execute here. Thanks for reading! I hope it was useful, and that you will share ssh tricks that are useful to others.

 

/simen

 


 

Twitter: https://twitter.com/simenhuuse

LinkedIn: https://www.linkedin.com/in/simenhuuse/