Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created an account to be used only for FTP sessions:

# 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

But when I try to login to the account I get the message:

530 User test access denied.
Login failed.
share|improve this question
up vote 1 down vote accepted

User's shell has to be in /etc/shells. I think in your configuration /usr/sbin/nologin doesn't figure in this file. Change shell for your user to f.e. /usr/bin/passwd (first ensure it's in /etc/shells) and it should work.

share|improve this answer
Yep, the nologin is not defined in /etc/shells but the system recognizes it as if it were defined. – 0_0 Dec 1 '12 at 21:51
Is anything in logs (messages, security, ftpd.log)? – Krzysztof Księżyk Dec 2 '12 at 12:04
Apparently no, only the adduser logs. – 0_0 Dec 2 '12 at 14:56
I've checked it in my BSD instance and actually I couldn't login via ftp to created account but when I'm added /usr/sbin/nologin to /etc/shells everything started working properly – Krzysztof Księżyk Dec 3 '12 at 10:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.