Secure File Transfer AWS EC2


#1

Hello,

I am using amazon aws EC2 with Ubuntu but I am not able to Connect to Filezilla using sftp with username www-data it is giving me some error of

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

Please Help me in this as I am new to easy engine.

Regards,
Rahul Sadarangani


#2

You need to connect with user / key from amazon (usually ubuntu) OR you need to add ssh / keys to www-data user.


#3

No It Did not work out I tried getting same error


#4

You probably are trying to load the key in the wrong format. Depending on vs of filezilla it can convert for you, but generally it is best to make sure you have a .ppk first and use pageant to service the key to filezilla.

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

so:

  1. Make sure you convert your EC2 key to ppk using PuttyGen
  2. Make sure you launch pageant and load your ppk version of the key converted in step 1
  3. Launch Filezilla
  4. sftp://example.com

This is nice because you don’t have to somewhat unsafely store the keys in filezilla. PuttyGen even allows you to password protect the keys so password is required before pageant will load them.

This assumes you have SSH working for ubuntu user; if you don’t you need to configure SSH for ubuntu first.

After you verify default ubuntu user, you can setup your SSH keys for other users and convert them to ppk if you need to. You’ll need to make sure the other accounts are setup for SSH on the ubuntu/linux side of things. Your default ubuntu user account should already allows ssh – we setup our EC2s for SSH only, no password logins so in FTP / etc we need only key NO password. You can search on how to do this.

– All of this assumes you are on windows. If you are on unix or osx just skip filezilla and/or putty altogether and command line it using OpenSSH vs of the EC2 key - although you can use filezilla I suppose with keychain.


#5

Hello,

I was able to access sftp by disabling Password Authentication and getting access via password Now have i am not able to upload or write data getting Permission issue on write and delete on www-data


#6

Howdy,

Just to clarify, when you say:

sftp by disabling Password Authentication and getting access via password

What do you mean? You’ve disabled SSH and now use password authentication, or in filezilla you now have a proper SSH key and you don’t need to enter a password?

Now have i am not able to upload or write data getting Permission issue on write and delete on www-data

I’m thinking by this you are sftp via the ubuntu user and you don’t have write permissions to say, /var/www or directories owned by www-data?

You’ll need to fix up your ownership and permissions to solve. Depending on how you want your server to operate there are many options. Will you be the only one uploading files, or do you have multiple developers? Generally you don’t want to be using the www-data user for sftp / ftp access - you could grant another user group permissions to the www-data group and then that user can write (if you set the right sticky bits and top level permissions) but if you actually want to do that depends on how you plan to operate this server.

We have used a combination of symlinks for users with their own SSH / credentials, sticky bits, etc depending on if we are on the dev or production servers. We also have jobs which run that lock the file permissions down so that nobody can change them, when we want to update things we run another job that chowns back to www-data; but we’re far more locked down that your typical EE user.


#7

@davidedwards Thanks the issue is now solved.


#8

Hi Can you resolve mine issue also I am facing the same issues. I am new to EE & Linux

I am receiving Error: Disconnected: No supported authentication methods available (server sent: publickey)

I added pkk to pageant and tried SFTP with user www-data & pass but still getting error


#9