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.
                        
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 passwordThis 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.netThe key detail for Bluemix is knowing its CF API endpoint:
Region Name CF API Endpoint
US South Region api.ng.bluemix.net
United Kingdom Region api.eu-gb.bluemix.net
Sydney region api.au-syd.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)/[email protected] The authenticity of host '[api.ng.bluemix.net]:2222 ([158.85.156.18]: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,[158.85.156.18]:2222' (RSA) to the list of known hosts. cf:[email protected]'s password: Connected to api.ng.bluemix.net. sftp>