Connect SSH from Visual Studio Code to EC2 Instance

Connect SSH from Visual Studio Code to EC2 Instance

Connecting SSH from Visual Studio Code to an EC2 Instance is a quick alternative to using Cloud9.

  1. Download Visual Studio Code and the Remote - SSH extension:

You can download VS Code here: Download VSCode.

After downloading, install the following extension:

Create Workspace

  1. Open the SSH connection prompt:

Click on the icon in the lower-left corner of the screen, and a dialog box will appear.

Create Workspace

  1. Connect to Host:

Click on Connect to Host.

Create Workspace

  1. Add New SSH Host:

Click on Add New SSH Host.

Create Workspace

  1. Input SSH Host Name:

In the input box, enter eks-blueprint-remote and press Enter.

Create Workspace

  1. Configure SSH in config file:

Click on the path in C:\Users\ADMIN.ssh\config to configure it. Create Workspace

  1. Update SSH configuration:

In the newly configured SSH block, update the information with the correct IPv4 address of the EC2 Instance and the path to the Key Pair on your machine.

Create Workspace

  1. Connect to EC2:

Click on the SSH icon at the bottom left corner and start the connection.

Create Workspace

  1. Select Continue:

Choose Continue.

Create Workspace

  1. Select Linux:

Click on Linux

Create Workspace

  1. Open Folder:

Choose Open Folder and click OK.

Create Workspace

  1. Connected Interface:

This is what the interface looks like after connection. Create Workspace