I assume that you have VSCode installed.
1. Install an OpenSSH compatible SSH client
OS | Instructions |
---|---|
Windows 10 1803+ / Server 2016/2019 1803+ | Install the https://learn.microsoft.com/windows-server/administration/openssh/openssh_install_firstuse. |
Earlier Windows | Install https://git-scm.com/download/win. |
macOS | Comes pre-installed. |
Debian/Ubuntu | Run sudo apt-get install openssh-client |
RHEL / Fedora / CentOS | Run sudo yum install openssh-clients |
💡 If you do not have a SSH host set up, follow the directions for Linux, Windows 10 / Server (1803+), or macOS or create a VM on Azure.
2. Install Remote - SSH
extension on VSCode
3. Configure
- Open command palette:
cmd + shift + p
- Select
**Remote-SSH: Open SSH Configuration File**
- Select one of your config location, I’ll just pick the first one
-
Update the values
Host alias-you-will-use HostName Public-IPv4-DNS-of-Your-EC2-instance User ec2-user # default user name IdentityFile path/to/your/pem/file
Note
💡 When you create a new EC2 instance, you create a new Key pair and the pem file will be automatically downloaded via the browser.
4. Connect
- Open command palette:
cmd + shift + p
- Select
Remote-SSH: Connect to Host
- You will find the alias you set on the list
- Select the alias
- (I didn’t have this case but,) when it connects, there’s a chance you see a prompt to enter a passphrase for the key
- Check out this video if it happens
5. Open File or Folder
You can click the Open Folder
button on the explorer or press cmd + o
to open file or folders you want to work with.
You can install other VSCode extensions in SSH.
Top comments (1)
For those of you who are using small instances such as t3.micro, you might face the container shutting down because of high CPU usage. Please go to VSCode settings and click your remote tab, and uncheck the
Search: Follow Symlinks
. It helped me.