How I can create a FTP-only account, in FreeBSD?

5,665

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:
5,665

Related videos on Youtube

0_0
Author by

0_0

Updated on September 18, 2022

Comments

  • 0_0
    0_0 over 1 year

    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.
    
  • 0_0
    0_0 over 11 years
    Yep, the nologin is not defined in /etc/shells but the system recognizes it as if it were defined.
  • Krzysztof Księżyk
    Krzysztof Księżyk over 11 years
    Is anything in logs (messages, security, ftpd.log)?
  • 0_0
    0_0 over 11 years
    Apparently no, only the adduser logs.
  • Krzysztof Księżyk
    Krzysztof Księżyk over 11 years
    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