If you need to disable shell access for a particular user, that can be done by editing the line for that user in the /etc/passwd file. So if we needed to change it for a user that is named user, you would open that file with a text editor, then change the line that begins with the username. So, when opening that file, you should see something like this:
To remove the ability to log in with ssh, you can change the last path to /bin/noshell
Then save the file. Now that user will no longer be able to ssh into your box. This is useful to elevate the security of your machine if you have multiple users and only need ssh on certain ones.
Chris April 7th, 2011
Posted In: How To