Login to SSH with no password and no ssh-key

opensshsshsshd

Mission : Let's say my remote server's firewall is configured to allow only my specific home IP to connect to port 22 and because of this I am not worried about security for this test. And maybe I also plan on using a very complex username such as "user_name_82391274829"

Is it possible for me to SSH to my server like this ? :

ssh user_name_82391274829@server
server:/#

In other words, it simply logs in,
without a password and without an ssh-key.

Note :
It should also work with SCP

Best Answer

The other answer has many valid points. Read it because I won't repeat them. My answer is a practical guide.

  1. Set an empty password on the server (I assume user_name_82391274829 exists in the system; chpasswd needs root access):

    printf '%s\n' 'user_name_82391274829:U6aMy0wojraho' | chpasswd -e
    

    Note this is different from no password at all. After I set no password at all (passwd -d user_name_82391274829) the solution did not work, so stick to the above line with chpasswd -e.

  2. Proper values in sshd_config on the server:

    PasswordAuthentication yes
    PermitEmptyPasswords yes
    

    Invoke systemctl reload ssh.service or equivalent command to reload sshd.

Tested on Debian 9.

Related Question