Accessing Amazon EC2 in Filezilla SFTP

50,894

Solution 1

I use WinSCP instead of FileZilla to transfer files to/from my EC2 instance. Logging in with a PPK file is very simple. In addition, WinSCP provides a very nice GUI (I use the version that looks/acts like the regular Windows Explorer interface).

Note the PPK file is associated with the username and password from [Set2]. [Set1] simply connects you to a computer that has the credentials needed to access the EC2 instance. Since you transferred the *.pem (ssh private key) file, you should not need to use [Set1] anymore.

update:

Your developer may have configured your EC2 instance to only accept connections from bridge.hisdomain.com. Go to the AWS management console to see if that is the problem (Note the AWS account username and password are probably different than any of the passwords above):

  1. First, find out which security groups your EC2 instance is a member of.
  2. Then find out which inbound connections are allowed for those security groups.
  3. You need to find/add a rule that allows port 22(SSH) from your IP address.
  4. This source IP will allow all SSH requests from anywhere: 0.0.0.0/0.

Alternatively, you can try making an ssh connection from your local machine to figure how why the sftp connection is not working. Use Plink, the command-line version of Putty, with your PPK file and the -v option (for verbose.)


The process for using FileZilla with a PPK file seems quite convoluted. (Hint: you give your password to Pageant, not FileZilla! If you insist on using FileZilla, follow the instructions below:

Now run Pageant. In your system tray, you'll see the Pageant icon appear. Right-click the icon and select "Add Key" and select your private key (PPK) file. Follow the prompt to enter your pass phrase and you're done.

Now simply launch FileZilla and connect to your server using SFTP using SSH2 with a username and an empty password.

Solution 2

To connect to a running Amazon EC2 instance with Filezilla:

  1. Edit -> Settings -> Connection -> SFTP
  2. Click "Add keyfile..."
  3. Browse to the location of your .pem file and select it.
  4. A message box will appear asking your permission to convert the file into a supported format. Click Yes, then give the file a name and store it somewhere safe.
  5. 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.
  6. File -> Site Manager
  7. Add a new site wih the following paramerters:
    • Host: 123.456.789.123
    • Protocol: SFTP
    • Logon Type: Normal
    • User: username
  8. Connect to the new server

Solution 3

The following tutorial on YouTube walked me through the complete process (successfully! and in less than 10 minutes): http://youtu.be/QYDvtLofrtM

I am on MacOS, so when this tutorial prompts to open 'Edit'/'Settings' in FileZilla (presenter is on Windows), if you are on a Mac like me, then instead go to 'Filezilla'/'Preferences'

Solution 4

Some SFTP clients (like FileZilla) store all the SSH certificates in one pool and will try SSH certificates in sequence, so make sure your setting in /etc/ssh/sshd_config for "MaxAuthTries" is set high enough to include the "maximum possible" certificates you have in your SFTP client.

Share:
50,894

Related videos on Youtube

Yuya Kitajima
Author by

Yuya Kitajima

Updated on September 18, 2022

Comments

  • Yuya Kitajima
    Yuya Kitajima over 1 year

    I need help/guide how I can open my ssh access from a GUI or Filezilla.

    Here's the scenario my developer just left me with the login info to my Amazon EC2. Now I am finding difficulties in understanding all this stuff. I used PuTTy and command prompt just to connect to my server using ssh process. It uses some bridge process just to connect to my actual server.

    right now he provided me 2 sets of login.

    [Set1]

    • bridge.hisdomain.com
    • username
    • somepassword

    [Set2]

    [my process]

    in [Set1] I enter "bridge.hisdomain.com" in the hostname of PuTTy. after I hit Open It will open a terminal and will asked for a username. thats where I provide my [Set1] username and password.

    Ounce login, I then perform [Set2] Details. I will use "ssh [email protected]" after I enter it, It will then asked for my password.

    from there, when I do "DIR" in command prompt I will see al my files there. I wanted to download a directory there to my local drive but I am not familiar with the commands.

    I would like to access it just by using FileZilla or similar. And I've also tried this but I don't know what I'd miss, because It didn't work for me. I downloaded a .pem file from the [set1] because I can also access it using a regular FTP (filezilla) and I then converted that .pem file to .ppk.

    right now I'm kinda confuse what login info I should use for my FileZilla to access the server. I had success in loging via FTP using [Set1] login details. But my files aren't there. I only saw some folders and a .pem file.

    I can't login to my Filezilla using [set2] details. I tried FTP and SFTP. I also added the .ppk file in the settings of my fileZilla. But I had no success in loging in.

    any ideas what did I miss?

  • Yuya Kitajima
    Yuya Kitajima over 12 years
    I did follow this instructions "Logging in with a PPK file" but I can't seem to access it. my hunch is, I maybe not doing it right. my developer provided me this detail: "ssh [email protected]". I am guessing the User Name for my WinSCP is "username" and the host would be "123.456.789.123". My PPK is also already linked up. but I can't seem to connect. any ideas?
  • Leftium
    Leftium over 12 years
    @Pennf0lio: Since you already have a PPK file (downloaded from [SET1]), just follow the last three steps. Make sure you enter your password in the correct place (Not in the WinSCP login dialog "password" field! But in the "Enter Passphrase" box that pops up after selecting your PPK file.) One issue may be your developer locked down the EC2 instance so connections are only possible from the "bridge" domain. I added some details to my answer.
  • Yuya Kitajima
    Yuya Kitajima over 12 years
    thanks so much in taking time for helping me. I am not able to access Amazon console since the developer didn't provided me. I think it is not letting me access the [set2] host if its not coming from the [set1] bridge. are there way around? I am able to access the server using command line and using [set1] then [set2] info. But I can't go directly to [set2] without loging in to [set1]. Is there a way I can just download a directory inside terminal? Do I need to use sftp command in the terminal?
  • Yuya Kitajima
    Yuya Kitajima over 12 years
    basically for now I just want to download a directory to my local folder. that directory contains my server files and other files. any ideas?
  • Leftium
    Leftium over 12 years
    @Pennf0lio: Probably the easiest solution is getting in touch with your developer; ask them to get the files for you. Otherwise, your options are A) sftp (via commandline) files from EC2 to bridge account, then sftp files from bridge account to you local computer. B) Create an SSH "tunnel" from your local computer through the bridge account to the EC2 instance.
  • Yuya Kitajima
    Yuya Kitajima over 12 years
    Thank you very much for taking time in helping me. I now have access with the server using FileZilla. the developer removed the bridge. Thank you :)
  • Jeff
    Jeff about 12 years
    Why was the rest edited out of my comment? Is display of emotion not allowed on this site? lol ;)
  • sblair
    sblair about 12 years
    We just prefer a high signal-to-noise ratio. That's what makes the Stack Exchange sites far better than forums for quickly solving problems.
  • user4951
    user4951 almost 12 years
    Are we logging in via root?
  • Mokubai
    Mokubai over 11 years
    It would be good to summarize the finer points of the video here and provide the link for reference, other sites (and videos) are prone to disappearing and deletion over time.
  • Yasitha Waduge
    Yasitha Waduge over 10 years
    Thanks for step by step instructions, based on above steps i was able to connect successfully, this is step by step video guide created based on above. y2u.be/e9BDvg42-JI
  • Martin Prikryl
    Martin Prikryl about 9 years
    Active mode is for FTP, not SFTP. This does not make any sense.
  • kolobok
    kolobok over 4 years
    Almost works, except that *.pem file needs to be converted to *.ppk. And username is different depending on AMI (for amazon linux it's "ec2-user")
  • Paul Razvan Berg
    Paul Razvan Berg over 3 years
    Note that an EC2 running Ubuntu the user name has to be "ubuntu"