How to enable or disable shell access for a Linux user account

To disable shell access use the following command (replace username with the correct values for your situation – leave out the curly brackets).

chsh -s /sbin/nologin {username} or chsh - /usr/sbin/nologin {username}

To grant bash access use:

chsh -s /bin/bash {username}

This entry was posted in FAQ and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *