Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Work with remote directories in VSCode using Remote SSH

📅 2020-Jul-14 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

The Remote VSCode extension made it easy to open individual files residing on a remote computer using SSH in VSCode. However, opening invidividual files like this is not an ideal workflow when working on a project or directory of files.

The Remote - SSH extension makes opening and working with remote directories just as natural and fully-featured in Visual Studio Code as working with local directories. Once you set it up and have a remote directory open, you can browse the directory tree, open any files, find-replace and lookup definitions across all the files.

To use this:

To stop using password:

You will notice that VSCode asks for the remote password every time you open the remote directory or reopen VSCode. To avoid this, we need to understand how VSCode uses ssh and then provide the ssh client with an identity file as follows:

Tried with: Visual Studio Code 1.47 and Windows 10