{ 14 comments… read them below or add one }

1 Zach True November 17, 2006 at 5:38 pm

On a Debian system, the nologin file does not exist. Is this a file that I can create? If so, do I stick it in /etc? Do I have to link it to a file in /sbin? Also, what should be the contents of the file?



2 Thibs September 16, 2011 at 9:35 am

By the way, the command chsh is designed for changing shell (instead of using usermod)

e.g. :
chsh -s /bin/false tom


3 nixCraft November 17, 2006 at 7:13 pm


Good question.

Use /bin/false on Debian or Ubuntu Linux system. Both /sbin/nologin and /bin/false are binary file. Don’t softlink them with shell/perl script.

usermod -s /bin/false tom


4 max November 18, 2006 at 6:25 am

to deny non-root logins, simply ‘touch /etc/nologin’


5 R_Smith April 7, 2007 at 4:41 pm


I have CentOS on dedicated server with Cpanel/WHM installed.

I want more people to have access to Cpanel, but to disable main ftp domain access because if they FTP with the cpanel user/pass they will be able to access the folder MAIL.

What I did so far: I chaged the Cpanel/username password by: ssh passwd , this way the FTP password remained as the old one. This was a solution, because people were not able to use FTP with the Cpanel password. However, in 24h the FTP password was automatically synchonized with the Cpanel password – it became the same as cpanel password.

1. How to disable main domain ftp access for Cpanel user?
2. Maybe there is a way to disable automatic ftp password synchronization?

Thanks in advance!!!


6 nixCraft April 7, 2007 at 6:17 pm

You can use ‘FTP Manager’ to disable or enable FTP user.


7 R_Smith April 8, 2007 at 12:17 am

I was thinking about the main ftp account, that has access in the direcory that is one level up from public_html. There is no option in Cpanel to change this ftp account password.


8 nagendra rao April 16, 2007 at 7:25 am

i got one proble in sftp. how to blck sft service to a particular user


9 ruben June 18, 2010 at 3:18 pm

this info helped me !


10 Guan September 22, 2010 at 1:57 pm

Use a nologin/false shell is a quick solution to disable login completely. However, there are needs to only allow login from certain location, say only locally. Linux-PAM would allow a much finer grain login control. Check out ‘man access.conf’. It is pretty useful when you have very specific login restrictions.


11 jason January 10, 2011 at 9:32 am

I need a fix like this, that still allows the user to access vsftpd. I’ve looked around and it looks like installing some kind of secure shell is my only option. I’m hoping you may know a way that’s as easy as this modification. Thanks in advance.


12 Chris September 22, 2011 at 9:27 am


Make sure that this line is present in your /etc/pam.d/vsftpd:

auth required pam_shells.so

This will force users to have a valid shell to log in.
If you set a users shell to /bin/false or /sbin/nologin then FTP logins will not be allowed also.



13 suresh September 24, 2012 at 10:43 am

what is the server errors code?
i need some error codes?


14 rubence April 26, 2014 at 1:53 am

need gdm/kdm/xdm (graphical) login for user but still he wont login via shell .. is it possible ?


Leave a Comment

Previous post:

Next post: