Home Ask Login Register

Developers Planet

Your answer is one click away!

Sanjay.Joshi January 2017

How can my client perform diego-ssh proxy authentication against an IBM Bluemix CloudFoundry App

I am interested in using client tools such as ssh, scp and sftp to interact with my IBM Bluemix CloudFoundry App.

Specifically, there is a dynamically generated file/folder that is created by my app web installer that I would like to download locally to my laptop.

I've read about the recent Diego enablement and I'm interested in leveraging the diego-ssh proxy-authentication capabilities discussed here.


Sanjay.Joshi January 2017

Using the Cloud Foundry cf command line interface and following the diego-ssh guidance found here, you can complete a client proxy authentication as follows:

    $ cf ssh-code | pbcopy # paste authorization code when prompted for password

This authorization code can then be used as a password to invoke commands such as:

    # Direct SSH Client Interaction
    $ ssh -p 2222 cf:$(cf app your_bluemix_app_name --guid)/0@api.ng.bluemix.net

    # Secure Copy
    $ scp -P 2222 -oUser=cf:$(cf app your_bluemix_app_name --guid)/0 my-local-file.json api.ng.bluemix.net:my-remote-file.json

    # Secure FTP Transfer (GET, PUT, ...)
    $ sftp -P 2222 cf:$(cf app your_bluemix_app_name --guid)/0@api.ng.bluemix.net

The key detail is the target domain: api.ng.bluemix.net

With some combination of these clients, you can seamlessly move files between local and Bluemix CF App environments to fulfill a variety of end-user dev needs.

Here is a sample interaction:

    $ sftp -P 2222 cf:$(cf app goldi --guid)/0@api.ng.bluemix.net
    The authenticity of host '[api.ng.bluemix.net]:2222 ([]:2222)' can't be established.
    RSA key fingerprint is SHA256:ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx8.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '[api.ng.bluemix.net]:2222,[]:2222' (RSA) to the list of known hosts.
    cf:59xxxxx3-4xxa-4xxx-xxxe-x0x@api.ng.bluemix.net's password:
    Connected to api.ng.bluemix.net.

Post Status

Asked in January 2017
Viewed 2,057 times
Voted 12
Answered 1 times


Leave an answer

Quote of the day: live life