SFTP Gateway v3.0 uses port
2222 for the SSH protocol,
since the Java SFTP service is bound to port
When you connect over SSH, you need to override the default port.
Connect over Port 2222
Use the following command to SSH into the EC2 instance:
ssh -i private.key ec2-user@<ip-address> -p 2222
Note: You will be prompted to accept the server host key on first connection. The server host key is cached on your client machine, based the hostname and port.
The default SSH port is
22, so you need to explicitly set port
which is the port OpenSSH listens to.
When using SCP (which uses SSH behind the scenes), you will also need to specify port
scp -P 2222 local-file.tar.gz ec2-user@<ip-address>:/home/ec2-user/
If you created an EC2 Key Pair in
.ppk format, you can use this directly in PuTTY.
Otherwise, if your EC2 Key Pair is in
.pem format, you need to use PuTTYgen
to convert it to
.ppk format. PuTTY only supports the PPK (PuTTY Private Key) format.
- Open PuTTYgen and click Load to browse for your
.pemkey. When browsing for the key, be sure to select All Files in the dropdown menu to show all file types. Click Open when you have selected your private key.
- PuTTYgen will now convert your key to the proper filetype.
- To export your new PPK key, click Save private key.
You are now ready to SSH in to the server with PuTTY using the new
- Open PuTTY and select SSH as the connection type.
- In the Host Name field, enter
- In the Port field, change
- Expand the SSH section on the left, and click on Auth.
- Click on Browse to browse for the
.ppkkey, and click Open when you have selected it.
- To launch the SSH session, click Open.