Using a Visual Studio Code (VS Code) for SSH remote login can significantly improve your productivity. Although it is a remote environment, you can operate as if it were a local environment with high visibility of directory structure and an advanced text editor environment. Here are the steps for establishing SSH remote login with VS Code.
Open VSC and select the extension icon from the left sidebar. Search for the Remote Development extension and click on the Install button.
Remote Development includes the following extensions:
2. Click the setting icon to select the SSH config file
3. Select your SSH config file
When you select the file, you'll see the config file contents in the right window. (Please refer to the previous section about how to make the config file.)
By clicking on the arrow icon, you can connect to the host in the same window. When you click on the window icon, a new VS Code window opens and establish the SSH connection in the new window.
Note: VS Code may also ask the platform (OS) of the host server. Select Linux if asked.
If you want to show only your home directory (/home/ubuntu/
), press the ok
button. You can also change the highest directory. If you want to show the entire directory tree, type /
and press the OK button.
Select the Yes button to connect to the folder.
To open a Terminal in the VSC window, select Terminal on the Mac menu bar and click on New Terminal.
Now you can work on the remote server as if it were in the local environment.
Press the bottom left SSH green icon and find the "Close Remote Connection" menu in the search bar at the top. Click the "Close Remote Connection" menu to close the connection.
If you cannot establish the SSH remote connection on VS Code the first time, try the first remote connection using the Terminal application (see the previous section). It may solve the problem. You can use VSC starting from the second connection to the remote server.
Using a Visual Studio Code (VS Code) for SSH remote login can significantly improve your productivity. Although it is a remote environment, you can operate as if it were a local environment with high visibility of directory structure and an advanced text editor environment. Here are the steps for establishing SSH remote login with VS Code.
Open VSC and select the extension icon from the left sidebar. Search for the Remote Development extension and click on the Install button.
Remote Development includes the following extensions:
2. Click the setting icon to select the SSH config file
3. Select your SSH config file
When you select the file, you'll see the config file contents in the right window. (Please refer to the previous section about how to make the config file.)
By clicking on the arrow icon, you can connect to the host in the same window. When you click on the window icon, a new VS Code window opens and establish the SSH connection in the new window.
Note: VS Code may also ask the platform (OS) of the host server. Select Linux if asked.
If you want to show only your home directory (/home/ubuntu/
), press the ok
button. You can also change the highest directory. If you want to show the entire directory tree, type /
and press the OK button.
Select the Yes button to connect to the folder.
To open a Terminal in the VSC window, select Terminal on the Mac menu bar and click on New Terminal.
Now you can work on the remote server as if it were in the local environment.
Press the bottom left SSH green icon and find the "Close Remote Connection" menu in the search bar at the top. Click the "Close Remote Connection" menu to close the connection.
If you cannot establish the SSH remote connection on VS Code the first time, try the first remote connection using the Terminal application (see the previous section). It may solve the problem. You can use VSC starting from the second connection to the remote server.