The shell setting in /etc/passwd determines whether a Linux system user may log in via the shell or over SSH. If you don’t want a certain user to be able to log in, set the shell to /bin/false or /sbin/nologin.
For the user “otheruser” on Debian and Ubuntu Linux, here’s an example:
usermod -s /bin/false otheruser
For Redhat, Fedora or CentOS use /sbin/nologin:
usermod -s /sbin/nologin otheruser
Warning: Do not set the shell for the root user to /bin/false or /sbin/nologin!
The post How to prevent a Linux system user from logging into the system appeared first on FAQforge.
June 25th, 2025 – Canonical, the company behind Ubuntu, and Pure Storage, the IT pioneer…
Co-authored with Julie Muzina A year ago, during our Madrid Engineering Sprint, we challenged ourselves…
Welcome to the Ubuntu Weekly Newsletter, Issue 897 for the week of June 15 –…
This is the first optimized Ubuntu Core image available on MediaTek’s Genio 350, 510, 700,…
Data centers are expensive: automation is the solution Today, managing a data center requires striking…
Our first Ubuntu IoT Day in Southeast Asia – and our first ever event in…