安装 vsftpd 后,我的系统上就有了 ftp 用户。我为此帐户指定了密码。但是,我仍然无法以 ftp 用户身份登录(在命令行上,不涉及任何 ftp 协议)。
su - ftp
password:
... still the previous user is logged on
人们会想知道我为什么要这样做。好吧,我想通过 ftp 公开整个文件系统。人们会说,你不应该这样做,好吧......
答案1
原因很可能是由于该ftp
帐户具有/bin/false
或与其默认 shell 类似:
$ getent passwd ftp
ftp:x:116:127:ftp daemon,,,:/srv/ftp:/bin/false
就安全性而言,这可能不是一个好主意,但如果您想将用户 shell 设置为有效的值,您可以使用chsh
,例如:
# chsh ftp /bin/bash
chsh ftp
Changing the login shell for ftp
Enter the new value, or press ENTER for the default
Login Shell [/bin/false]: /bin/bash