6

I followed the step six at https://www.digitalocean.com/community/tutorials/how-to-use-ssh-keys-with-digitalocean-droplets but I still get a password prompt when I try to connect to the server using ssh from other machines that don't have the private key.

Troubleshooting ideas? Thanks

5
  • The guide only denys root login via password. Are you using antother user to log in?
    – Pabi
    Nov 3, 2014 at 15:27
  • I'm trying "ssh root@myipaddress" which gives "root@myipaddress's password:" Nov 3, 2014 at 15:38
  • Have you restarted the ssh server after chaning the config? If so, please edit your post with your /etc/ssh/sshd_config.
    – Pabi
    Nov 3, 2014 at 15:40
  • I ran "service ssh restart" but get the same problem. /etc/ssh/sshd_config is at pastebin.com/zCwbDTAU Nov 3, 2014 at 15:47
  • Config looks fine. If the server restart was successfull please edit the question with the output from ssh -vv root@server. Make sure to replace the IP in the output.
    – Pabi
    Nov 3, 2014 at 16:03

1 Answer 1

6

That is normal behaviour. You will be prompted for a password, but if PermitRootLogin without-password is set, then no password will work. If you don't want to be prompted for a password at all, then set in your sshd_config:

PasswordAuthentication no

If you only want to deny it for root, try:

Match User root
    PasswordAuthentication no
5
  • Match User root PasswordAuthentication no seems to have worked :) Can anyone confirm you should still see the prompt if you use without-password (I'm hosting my machine with digital ocean and don't really want them to e-mail me the password for me to try this theory out)? Nov 3, 2014 at 16:25
  • @user3553107 Anyone other than me?
    – muru
    Nov 3, 2014 at 16:27
  • After the amount of dubious comments on the original guide I posted it's always good to check ;) If you had a man page etc stating the expected behaviour that would be great Nov 3, 2014 at 16:37
  • @user3553107 The manpage doesn't mention the expected behaviour, but this question shows imilar behaviour.
    – muru
    Nov 3, 2014 at 16:41
  • @user3553107: check the comment above UsePAM yes in your /etc/ssh/sshd_config Nov 3, 2014 at 17:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .