我创建了一个仅用于 FTP 会话的帐户:
# adduser
Username: test
Full name:
Uid (Leave empty for default):
Login group [test]:
Login group is test. Invite test into other groups? []:
Login class [default]:
Shell (sh csh tcsh bash rbash nologin) [sh]: nologin
Home directory [/home/test]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:
Enter password again:
Lock out the account after creation? [no]:
Username : test
Password : *****
Full Name :
Uid : 1002
Class :
Groups : test
Home : /home/test
Home Mode :
Shell : /usr/sbin/nologin
Locked : no
OK? (yes/no): yes
adduser: INFO: Successfully added (test) to the user database.
Add another user? (yes/no): no
Goodbye!
但当我尝试登录帐户时收到以下消息:
530 User test access denied.
Login failed.
答案1
用户的 shell 必须位于 /etc/shells 中。我认为您的配置中 /usr/sbin/nologin 未出现在此文件中。将用户的 shell 更改为 fe /usr/bin/passwd(首先确保它位于 /etc/shells 中),它应该可以正常工作。