How to delete or remove user password in Linux?

Some times you require to set passwordless logins to a user for auto logins, shell scripting so that you no need to provide any password. This can be achieved by using passwd command with -d option which deletes already assigned password.

passwd -d username


passwd -d temp

Removing password for user temp.

passwd: Success

Once you are done with this change the password field in /etc/shadow field is changed to empty so that without password you can login from any machine to the local machine.

Update: Some users pointed out that this works only for local logins, but for remote logins this will not work.


The following two tabs change content below.
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.