Accessing EC2 via ssh is the best option in my opinion for developers but sometimes people with minimal development skills needs to access web servers to upload images, videos, audio etc. with tools such as Filezilla, Cyberduck and WinScp. The post will demonstrate how to access Amazon EC2 via SFTP protocol.
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction.
Go to the AWS management console
- First, find out which security groups your EC2 instance is a member of.
- Then find out which inbound connections are allowed for those security groups.
- You need to find/add a rule that allows port 22(SSH) from your IP address.
- This source IP will allow all SSH requests from anywhere: 0.0.0.0/0.
- Edit (Preferences) > Settings > Connection > SFTP, Click “Add key file”
- Browse to the location of your .pem file and select it.
- A message box will appear asking your permission to convert the file into ppk format. Click Yes, then give the file a name and store it somewhere.
- If the new file is shown in the list of Keyfiles, then continue to the next step. If not, then click “Add keyfile…” and select the converted file.
- File > Site Manager Add a new site with the following parameters:Host: Your public dns name of ec2 instance, or the public ip address of the serverProtocol: SFTP
Logon Type: Normal
User: From the docs: “For Amazon Linux, the default user name is ec2-user. For RHEL5, the user name is often root but might be ec2-user. For Ubuntu, the user name is ubuntu. For SUSE Linux, the user name is root. Otherwise, check with your AMI provider.”
Press Connect Button – If saving of passwords has been disabled, you will be prompted that the logon type will be changed to ‘Ask for password’. Say ‘OK’ and when connecting, at the password prompt push ‘OK’ without entering a password to proceed past the dialog.
Note: FileZilla automatically figures out which key to use. You do not need to specify the key after importing it as described above.
[…] How to access Amazon EC2 via SFTP protocol? […]