Freebsd
如何在 FreeBSD 中創建僅 FTP 帳戶?
我創建了一個僅用於 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.
使用者的 shell 必須在 /etc/shells 中。我認為在您的配置中 /usr/sbin/nologin 不在此文件中。將您的使用者的 shell 更改為 fe /usr/bin/passwd(首先確保它在 /etc/shells 中),它應該可以工作。