I am sort of a Unix newbie, trying to set SSH for my 12.04 server.

I have 2 users in my system one has password the other does not, both are set as admins. My object is have the passwordless user able to ssh with and without password (that is what my application needs)

I am doing key-gen and trying to copy the key to the server (Local host) With the user that has password everything seems to work fine - I can SSH without the password prompt after copying the key to the server. But with the passwordless user it fails because I cannot copy the key file over. (Did generate the key file under both users - don't know if that is necessary) Tried PasswordAuthentication no - that did not work, so commented back to default I do have PermitEmptyPasswords yes - but no help.

$ cat ~/.ssh/id_rsa.pub  >> ~/.ssh/autorized-keys
$ ssh-copy-id -i ~/.ssh/id_rsa.pub user@localhost

asks for password

  • 1
    So your question is: How do I enable SSH public key authentication for a user that has no password on the remote host? – ntninja Aug 9 '14 at 19:12
  • So just hitting Enter when it asks for the password doesn't work? – jaia Aug 9 '14 at 20:33
  • Did you try explicitly setting the public key to use when connecting to the other user: ssh -i <private key file> <user2>@localhost ? – ntninja Aug 10 '14 at 18:54
  • If I just hit enter - when it asks for password - it does not work. Whenever I try doing anything for the user - it asks for te user password. So kinda stuck. The only work around I have done is simply set a password - complete this SSH cert thing and then remove the password again. – SamB Aug 11 '14 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.