You can install Visual Studio Code using the following commands:
sudo snap install --classic code
- Open Visual Studio Code.
- Go to the left sidebar and click on the Extensions icon (or press
Ctrl+Shift+X
). - Search for "Remote - SSH" and install the extension provided by Microsoft.
- Open the command menu (
Ctrl+Shift+P
) and search for the "Remote-SSH: Connect to Host..." command - Go on
Add New SSH Host
and add your SSH server asssh [email protected]
andssh [email protected]
To acces on hercules you need to modify the SSH config:
- Go on the left sidebar and click on "Remote Explorer"
- Select the configuration file
~/.ssh/config
(oconfig
) - Find the definition of hercules server and add, under the
User
specification, the port to usePort 22
and the proxy jumpProxyJump cerbero.mib.infn.it
- Go the left sidebar and click on "Remote Explorer"
- Open the "REMOTES (TUNNELS/SSH)" section and than the "SSH" section. You will found the option
cerbero.mib.infn.it
andhercules.mib.infn.it
- Click to connect: you will be prompted to enter the password for your server if you haven't configured SSH keys.
When you try to connect to hercules, you will be prompted to enter the password first for cerbero and after for hecules. Pay attention what VS ask for. After the connection, you can work directly on the remote server.
When you're done working, you can disconnect from the remote server by clicking on the icon in the bottom-left corner of Visual Studio Code and selecting "Disconnect Remote."
Now you're ready to start working on your remote server using Visual Studio Code!