With VSCode SSH, you can directly ssh to remote servers. This means you can use the editor on your local machine and run processes on the remote server. It’s like a GUI SSH client that runs inside vscode.
– Windows 7 / Windows 2008 R2 or later (should work on Win7, but will require PowerShell 3)
– Mac OS 10.10 or later.
– Linux 2.6.23 or later (glibc 2.17)
– OpenSSH client tools installed and available in your PATH
– The architecture must match the architecture of VS Code (e.g., if you have 32 bit VSCode, you will need a 32 bit OpenSSH client installation)
– Directly connect to a system via SSH; no external tools required (except for your OS’s native OpenSSH client).
– Connect to multiple systems at once, even with different user credentials for each system simultaneously.
VSCode SSH is an extension that allows you to use an ssh connection to develop code. I would recommend this extension because it allows you to code on remote servers and have all the IDE features available locally. You can download it from the extensions page in VSCode or from [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh)
1. Install the [Remote Development](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) extension pack
2. Create a file ~/.ssh/config with following entry:
SSH Host: ssh.wuxiangan.com
SSH Port: 22
SSH User: wuxiangan
SSH Auth method: Private Key
Private key file: ~/.ssh/id_rsa
When you are developing applications in the cloud, it is often necessary that you need to work remotely. There are various ways of working remotely, however, this tutorial will focus on getting a free developer account at Digital Ocean and setting up the SSH connection via Visual Studio Code.
We will first set up the SSH connection to Digital Ocean via PuTTY. Then we will set up Visual Studio Code with the Remote Development Extension Pack. Finally, we will configure Visual Studio Code to use our SSH connection to Digital Ocean.
Let’s get started!
Setting Up Your SSH Connection With Digital Ocean
First, you’ll need a free developer account at Digital Ocean. If you sign up via this link, you’ll get $100 worth of credit which should be more than enough if you’re new to cloud development!
I have a server I run in Digital Ocean with a Postgres DB that hosts a production database for an app that I’m working on.
I’d like to connect to this database from my local development machine, so I can do work on the production data and write migrations.
What is the best way to securely achieve this?
I’m aware of tools like https://postgresapp.com/, which allows me to connect to remote databases via SSH. However, it would defeat the purpose if I had to open up my database port for anyone to access it.
I’m also aware of the official Postgres app https://postgresapp.com/downloads.html, however, this only allows me to connect locally to my development database via TCP.