In Linux system’s we could disable or delete passwords of an user account, this way we could disable user login. These option could achievable through many way. We would discuss this with delete user’s password from Linux system

So we would see how to user could not login once applying these changes.

Delete user password

We could delete user password or make it empty, this way user can’t login further on system locally or from remote machine. Below method could use to delete password from Linux system.


# password --delete u1

We have below one example for same.

# passwd --delete u1
Removing password for user u1.
passwd: Success

We can also verify password has been deleted or not

# grep u1 /etc/shadow

In this case user can’t login on system locally or remotely. While login it will show below message on screen and on logs.

User try to login from remote
# ssh u1@
u1@'s password: 
Permission denied, please try again.

Below message displayed on /var/log/secure
Nov 25 15:18:23 localhost sshd[1451]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=  user=u1
Nov 25 15:18:25 localhost sshd[1451]: Failed password for u1 from port 41224 ssh2