1

I have an AWS EC2 instance running an Ubuntu 12.04 web server that I host Wordpress on. For Wordpress to update, it's asking me to supply FTP credentials. I have set up FTP according to this post: http://stephen-white.blogspot.co.uk/2012/05/how-to-set-up-wordpress-on-amazon-ec2_31.html

But the FTP user I created (ftpuser) can't log in. WP only gives very vague errors, but I tried using FTP in the OSX terminal, which gives 'Login incorrect', but the password is definitely correct. I can FTP in using my normal username and password.

This is the content of my vsftpd.conf file (I've removed all commented out lines):

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd/empty
pasv_enable=YES
pasv_min_port=14000
pasv_max_port=14050
port_enable=YES
pasv_address=54.241.13.224
pasv_addr_resolve=NO

This is an nmap of the servers ports:

PORT      STATE  SERVICE
20/tcp    closed ftp-data
21/tcp    open   ftp
22/tcp    open   ssh
80/tcp    open   http
443/tcp   closed https
14000/tcp closed unknown

The /var/www (where I have Wordpress installed) folder is owned by ftpuser and this is the entry for the ftpuser in the file /etc/passwd:

ftpuser:x:1001:1001::/var/www:/sbin/nologin

I'm only an amateur server admin, so haven't a full clue of what I'm doing. Anyone have any ideas why this is happening and what needs to be done?

henrywright
  • 10,070
  • 23
  • 89
  • 150
skeniver
  • 2,647
  • 6
  • 28
  • 34

1 Answers1

0

If you are receiving the following error message "Login incorrect" on AWS EC2:

331 Please specify the password.

Password:

530 Login incorrect.

ftp: Login failed

There is a problem with login using Shell. To overcome this there is one further step missing after the following in that Blog Post:

Add an FTP user, giving access only to the WordPress files and for additional security >ensuring the user can not open a shell:

useradd ftpuser -d /var/www/html -s /sbin/nologin

Add the following:

Add /usr/sbin/nologin on to the last line of /etc/shells file:

$ vi /etc/shells

/usr/sbin/nologin

Try logging in again using your FTP client. That's how I got it working on my instances.

Community
  • 1
  • 1
Abdul Hamid
  • 189
  • 2
  • 4