Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have 2 users to whom i want to disable terminal access, but still keep ftp access.How do I achieve this?


Forgot to mention, I'm using vsftpd.

share|improve this question
up vote 3 down vote accepted

Proftpd will not allow nologin shell, just disable the non-shelled users in SSH by allowing only trusted shell users:

In sshd_config :

AllowUsers toto john chuck morice
share|improve this answer
Altough this was not the kind of solution I was after, since I wanted to do something with FTP server, but it did provide a solution. – Janis Peisenieks Jul 11 '12 at 8:01

You can disable shell with:

usermod -s /sbin/nologin <ftp_user>

or use virtual users.

share|improve this answer

As I just stumbled upon this post:

Setting the login shell to /sbin/nologin using e.g. quanta's comment might result in some login problems with the message (530 Login incorrect). This can be the result of this shell not being registered with the system. Just add it to /etc/shells and the problem solves.

(Same for /bin/false ...)

share|improve this answer

Due to

RequireValidShell directive in proftpd which is by default ON one needs to either add /bin/false to /etc/shells or turn RequireValidShell to off and then

usermod -s /bin/false <ftp_user>

reference : proftpd RequireValidShell directive man page

share|improve this answer

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.