Connecting to AWS EC2 Instance with WinSCP and Integrating with PuTTY: A Step-by-Step Guide
Amazon Web Services (AWS) offers a variety of computing services, including EC2 instances, which are virtual servers that can be used to run applications and services. In order to transfer files to and from an EC2 instance, you will need a file transfer client like WinSCP. Additionally, integrating WinSCP with PuTTY can provide a more seamless and efficient way to connect to an EC2 instance.
Part 1: Connect to AWS EC2 using WinSCP
Step 1: Download and install WinSCP
Download WinSCP from the official website and install it on your local machine.
Step 2: Obtain connection details for AWS EC2 instance
Log in to your AWS account and navigate to the EC2 Dashboard. Locate the instance you wish to connect to and obtain its connection details including the public DNS, username, and password or private key.
Step 3: Configure WinSCP for connection
Open WinSCP and click on the “New Session” button. In the “Session” screen, enter the following details:
- File protocol: SFTP
- Host name: Public DNS of the AWS EC2 instance
- Port number: 22 (default)
- User name: The username for the instance (e.g., “ec2-user” for Amazon Linux)
- Password or Private key: Choose the appropriate authentication method based on the instance configuration. If using a password, enter it in the password field.
- If using a private key, click on the “Advanced” button and select the path to the private key file.
Click on “Save” to save the session configuration.
Step 4: Connect to AWS EC2 instance
Click on the “Login” button to connect to the AWS EC2 instance. If successful, you should be able to browse and transfer files between your local machine and the remote instance.
Part 2: Integrate WinSCP with PuTTY
Step 1: Download and install PuTTY
Download PuTTY from the official website and install it on your local machine.
Step 2: Configure PuTTY for connection
Open PuTTY and enter the following details in the “Session” screen:
- Host Name: Public DNS of the AWS EC2 instance
- Port: 22 (default)
- Connection type: SSH
Click on “Open” to open the SSH session. If prompted, enter the username and password or private key passphrase to log in to the instance.
Click “OK” to save the changes.
Step 3: Connect to AWS EC2 instance via PuTTY
To connect to the AWS EC2 instance via PuTTY, open WinSCP and select the session you created in Part 1. Click on the “New Session” button and choose “PuTTY” as the protocol. Click on “OK” to open the SSH session via PuTTY. If prompted, enter the username and password or private key passphrase to log in to the instance.
Part 3: Automatically open PuTTY on WinSCP connection
- Open WinSCP and go to “Session” in the left-hand menu.
- Click on “Default Settings” and go to the “Integration” tab.
- Check the box next to “Use PuTTY in default SSH terminal” and browse to the location where your PuTTY executable is installed.
- Click “OK” to save the changes.
- Now when you connect to a remote server using WinSCP, it will automatically launch PuTTY as well.
- In the PuTTY window, enter the username and password for the remote server and click “Open” to establish the SSH connection.
Congratulations! You have now successfully integrated WinSCP with PuTTY. This will save you time and effort in managing your SSH connections to AWS EC2 instances.