3

I am trying to ssh to localhost, but it's asking for a password every time.

What I tried:

ssh localhost
ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa 
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
1
  • Please edit your post to include the output of ssh -vv localhost
    – muru
    May 15, 2016 at 19:46

1 Answer 1

5

DSA keys are not accepted in recent versions of openssh by default. You should use rsa, which works fine and is considered more secure by the openssh developers. If you really want to use dsa keys, you should add

PubkeyAcceptedKeyTypes +ssh-dss

line into your sshd_config and restart ssh service.

1
  • This did the trick. Thank you. The way to discover this is that logging into the server with the -vvv flag has a line debug3: receive packet: type 51 inside of the output that reveals that the authentification failed. Jan 23, 2019 at 17:18

You must log in to answer this question.

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