This is an old revision of the document!
TODO
# create the .ssh directory (if not already there) [gcloud]$ mkdir -p ~/.ssh # print out your fep.grid.pub.ro public key and copy it [fep]$ cat ~/.ssh/id_rsa.pub # configure your fep.grid.pub.ro public key on gcloud instance [gcloud]$ vim ~/.ssh/authorized_keys
# create a reverse ssh tunnel from your computer to the cloud instance [localhost]$ ssh -T -N -R 43210:localhost:22 ${GCLOUD_USERNAME}@${GCLOUD_IP} # show tcp listeners (bound ports, processes, etc.) [gcloud]$ sudo netstat -tlpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:43210 0.0.0.0:* LISTEN 1931/sshd: ........ tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 448/systemd-resolve tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 893/sshd: /usr/sbin # test that the reverse ssh tunnel works [gcloud]$ ssh ${LOCALHOST_USERNAME}@localhost -p 43210 # connect from fep.grid.pub.ro to your localhost via gcloud instance [fep]$ ssh -J ${GCLOUD_USERNAME}@${GCLOUD_IP} ${LOCALHOST_USERNAME}@localhost -p 43210