enable both password and key file to ssh logon in ?

Posted February 17, 2015 16.1k views

one vps server and two client machine.
Can i set the vps server to be logon in via password on machine 1 at the same time to be logon in via key file on machine 2?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

This doesn’t seem to be true anymore (no fallback to password). I also can’t find a setting. Am I missing something?

  • Same here. Doesn’t fallback to password mode for me either.

    • What you have to do is edit the /etc/ssh/sshd_config file and provide PasswordAuthentication with a value of Yes.

      $ sudo vim /etc/ssh/sshd_config


      PasswordAuthentication no
      press i for insert mode

      Change to:

      PasswordAuthentication yes

      Save and Close

      [escape] :wq

      Restart Your SSH

      $ sudo systemctl restart ssh
      Some systems make require
      $ sudo systemctl restart sshd

Yes, that’s the default setting actually. Just set up an SSH key for your user and when you connect to your droplet without an ssh key (machine 2) it will fall back to a password prompt.