How to allow ssh with empty passwords in Linux

Question: How can we allow a user with empty password to login to a Linux system?

Although it seems a risky requirement, but sometimes in a private, development environment this can come handy. Also openssh provides you with an option to have empty passwords for users while doing ssh.

From the man page of sshd_config:

# man sshd_config
...
     PermitEmptyPasswords
             When password authentication is allowed, it specifies whether the server allows login to accounts with empty password strings. The default is no.

So by default, ssh will not allow users to login with empty passwords. But if we set the PermitEmptyPasswords parameter value to “yes” in the configuration file /etc/ssh/sshd_config, users can login with an empty password.

# vi /etc/ssh/sshd_config
PermitEmptyPasswords yes

Make sure to unhash the parameter if it is hashed out in the configuration file.

Related Post