PDA

View Full Version : [SOLVED] User security: How to allow ftp login and deny interactive logins


Yakov Hrebtov
November 15th, 2007, 07:49 AM
I want to setup user as ftp-only user.
On Fedora I can assign to user /usr/sbin/nologin shell. Such user cannot work interactively, but can work as ftp user.

On ubuntu, user with dummy shells (/usr/sbin/nologin, /bin/true for example) cannot connect as ftp user (I tested this using vsftpd server).

How can I do what I need?

Thanks in advance!

P.S. Also I wonder why almost all ubuntu system users has real /bin/sh shell!

stevux
November 15th, 2007, 08:18 AM
about the shell/login issue;
Try adding '/bin/false' to the '/etc/shells' file, and give the ftp users this shell.

Actually, I would not exactly know the difference between having '/bin/true' or '/bin/false' as a shell, but i prefer 'bin/false'. If this does not work for you, maybe you should stick to '/bin/true'.

You also might want to try and set "check_shell=NO" in you 'vsftpd.conf' file.


about the shells for daemon users;
Most likely, the daemons need a shell to perform actions, and usually envvars are an important way of setting/communicationg options.

hth,

Yakov Hrebtov
November 15th, 2007, 08:53 AM
Thanks!
Adding dummy shells to /etc/shells helps!