Way 1 : Move the user into /sbin/nologin shell syntax : usermod username -s /sbin/nologin [root@localhost ~] ...