How can I ssh into my Cloud9 workspace?

I want to ssh into my Cloud9 workspace. I have set the default "ubuntu" user's password using sudo passwd ubuntu, although this gets reset every time I reload the IDE. I found the workspace's IP using curl ipecho.net/plain and then scanned it with nmap and found that port 22 is open. It is hosted by Google Cloud, and changes whenever I reload the IDE. When I try to connect over ssh, my connection times out. The ssh terminal in Cloud9 is connected to a treasure data website over https. When I scan the treasure IP, ssh is not open. I think it is being tunneled or something. Doing sudo lsof -i, I learned that the workspace is running dropbear on port 58777 on some local IP, but I don't think this affects ssh'ing from the outside.

So there is the Google Cloud IP with ssh open, but to which I cannot ssh, the treasure data IP which is probably tunneled, and a few Cloud9 local IPs which I can't connect to anyway. How can I ssh into my Cloud9 workspace?


The network traffic can be simply redirected using tunnelling, however cloud9 sshd does not allow to log in using password, and the ~/.ssh/authorized_keys file is protected.

You can bypass this, by setting up your own dropbear on cloud9. I have done it like this:

wget https://matt.ucc.asn.au/dropbear/dropbear-2015.67.tar.bz2
tar xjf dropbear-2015.67.tar.bz2
cd dropbear-2015.67
./configure --prefix /home/ubuntu/workspace

added the following line:

#define DEBUG_HACKCRYPT "hL8nrFDt0aJ3E" /* this is crypt("password") */

to options.h, then:

make
make install

Then I have run dropbear on port 2222:

cd /home/ubuntu/workspace
bin/dropbearkey -t rsa -f dropbear_rsa_host_key
sbin/dropbear -E -F -p 2222 -r dropbear_rsa_host_key

On another cloud9 terminal I have tunelled the port 2222 to some.server:

ssh [email protected] -R 2222:localhost:2222

After doing this I was able to login from some.server:

ssh -p 2222 ubuntu@localhost

using password "password".