sftp to ec2 instance using FileZilla/Putty

0

0

I can only login to my ec2 instance via Putty/FileZilla if I use the username ubuntu. This is fine for putty as i can then su but in filezilla I am not able to add any files as I am not able to su.

In putty I get the error Disconnected: No supported authentication methods available (server sent: publickey).

In FileZilla I get the message

Error: Disconnected: No supported authentication methods available (server sent: publickey) Error: Could not connect to server

What do I need to look to change here to get this working? Let me know if there is any more info I could provide to help here.

ak85

Posted 2013-07-30T11:37:52.793

Reputation: 55

Your private .ppk key in putty is probably incorrect. – harrymc – 2013-08-03T11:30:48.580

Answers

2

First of all, lets quote the wiki:

Importing a site's public key is not supported. It's not possible to pre-cache a public key (which I had obtained as a keyfile from the site's administrator) to verify the server is the one you're trying to connect to. Eventually I had to run ssh-keygen -l -f on a Linux box, then perform a visual comparison.

Once you have understood this, lets assume you have a .ppk file from your Putty installation, which come down to two possible solutions:

Using Pageant

Pageant is a daemon-like agent for storing your private keys saving you the time to put your passwords each time you want to use your stored ssh keys.

  1. You should already have installed Putty, then go to the Putty directory in your Start Menu, and select Pageant.
  2. It should appear a small icon in the notification area (besides the clock), right click it then select Add...
  3. Look for you private key, will ask you for your password, then accept.
  4. Open FileZilla, and it should find Pageant running so it will take your private key and authenticate to your server.

Manual method

In FileZilla:

  1. Go to Edit > Preferences menu.
  2. In the Connection - SFTP tab, look for Add key file... button.
  3. Look for your key and hit Open.

FileZilla will convert this file from Password protected to no password during the importation.

For everything else

FileZilla supports almost any SSH Agent, if the SSH_AUTH_SOCK is set in the environment variables. Please refer to your documentation for your agent in this case.

Source: https://wiki.filezilla-project.org/Howto#SFTP_using_SSH2:_Key_based_authentication

Braiam

Posted 2013-07-30T11:37:52.793

Reputation: 4 526

Thanks for your advice. I already had the manual method working, my issue is that this only works for the user ubuntu and this user doesn't neccesarrily have access to all these folders. As this is a small project I am just going to manage it by giving ubuntu access to the required folders, probably not the solution for a larger scale team though. – ak85 – 2013-08-10T03:15:12.327

1@ak85 if you are using Ubuntu, you can use the integrated tools for managing SSH keys, like Seahorse. – Braiam – 2013-08-10T13:04:17.310

@ak85 btw, if my answer was answered your question, you should accept it. And if I'm worthy of the bounty award it to me too ;) – Braiam – 2013-08-10T23:41:05.900

2

Useful answer, just created step by step instructions video based on answer, http://y2u.be/e9BDvg42-JI

– Yasitha Chinthaka – 2013-11-01T13:05:01.203

1

It happens in AWS EC2. As EC2 provide Connection through an SFTP need some other methods. Firstly the CONNECTION will be in FTP as default. Need to change to SFTP. Then instead of directly giving host name and password, it must be done in Site manager. Step by step procedure given below:

So the steps for troubleshooting:

  1. Go to Filezilla's Settings
  2. SFTP
  3. Add Key File (Give the ppk converted key file or FZ will convert the pem ket)

Then take File in Filezilla Go to

  1. File
  2. Site Manager
  3. New Site
  4. Give any name (ec2-amazon)
  5. In General, give host name 'Public DNS' (eg: ec2-34-423.ap-southeast...)
  6. Change the Protocol to SFTP
  7. Logon Type: Normal
  8. User : ec2-user or ubuntu - depends
  9. Clear Password
  10. Connect!

Hope you will be connected. Happy Hosting...:)

Amith Ajith

Posted 2013-07-30T11:37:52.793

Reputation: 19