Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
Goodbye!

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

530 User test access denied.
Login failed.
share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.