1

我有一个运行我托管 Wordpress 的 Ubuntu 12.04 Web 服务器的 AWS EC2 实例。要更新 Wordpress,它要求我提供 FTP 凭据。我已经根据这篇文章设置了 FTP:http: //stephen-white.blogspot.co.uk/2012/05/how-to-set-up-wordpress-on-amazon-ec2_31.html

但是我创建的 FTP 用户(ftpuser)无法登录。WP 只给出了非常模糊的错误,但我尝试在 OSX 终端中使用 FTP,它给出了“登录不正确”,但密码肯定是正确的。我可以使用我的正常用户名和密码进行 FTP 访问。

这是我的 vsftpd.conf 文件的内容(我已经删除了所有注释掉的行):

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

这是服务器端口的 nmap:

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

/var/www(我安装了 Wordpress)文件夹归 ftpuser 所有,这是文件 /etc/passwd 中 ftpuser 的条目:

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

我只是一个业余的服务器管理员,所以对我在做什么并不完全了解。任何人都知道为什么会发生这种情况以及需要做什么?

4

1 回答 1

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.

于 2013-06-02T19:03:28.407 回答