Codespace as SSH Proxy

How to connect to a SSH Server using a Github Codespace as a Proxy (JumpHost)

In Codespace

Creating new sudo user

sudo adduser  # dont leave password blank
sudo usermod -aG sudo user # add user sudo permissions
sudo visudo

Find these lines and add permissions for new user:

User privilege specification
root ALL=(ALL:ALL) ALL
user ALL=(ALL:ALL) ALL

save ctrl+x ; y ; enter

Editing ssh config

replace port by any port you want for example 8282

sudo nano /etc/ssh/sshd_config
sudo service ssh start
ssh -R 6363:localhost:8282 serveo.net # any source port for example 6363

Local Computer

Connection test

ssh user@serveo.net -p 6363

SSH Config

After that, host will appear in vscode remote tab. F1>ssh config (open config file)


  HostName serveo.net
  User user
  Port 6363

Host studies
  HostName YOUR_SERVER_IP
  User ubuntu
  IdentityFile ~/.ssh/studies.key
  ProxyJump codespace

Now you can directly connect through remote connection menu in vscode, thanks to this you can benefit of all vscode feature set, extensions on your server without connecting directly to it.

Last updated