0

I have recently setup ssh on two linux machines (lets call them server-a, client-b). I have generated two ssh auth files on client-b machine using ssh key gen and can see both public and private files in .ssh dir. I have named them 'example' and 'example.pub'.

Then I have added example.pub to sever-a's auth file. When I try to ssh into server-a it still requests a password authentication where as I want a password less login (private key on client-b is setup without password).

When I try to ssh with '-v' .. get the following output:

debug1: Next authentication method: publickey
debug1: Trying private key: /Users/abc/.ssh/identity
debug1: Offering public key: /Users/abc/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering public key: /Users/abc/.ssh/id_dsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,keyboard-interactive
debug2: we did not send a packet, disable method
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password: 

Please help.

  • can you be a little more precise about how you put the key on the server? You said "auth file". Could you list the exact name and location you put the key? – Trevor Harrison Apr 27 '10 at 15:00
  • 1
    If you really named your keyfiles example and example.pub, ssh nor sshd will know where to find them. Just use the standard filenames suggested by ssh-keygen and copy the public key to remote server as .ssh/authorized_keys – Alex Holst Apr 27 '10 at 15:27
1

You may also use 'ssh-copy-id' to upload the public key to the server.

Syntax is:

ssh-copy-id [-i [identity_file]] [user@]machine

Respond to Trevor's questions above if that doesn't work.

0

Pubkey auth can be kind of annoying sometimes. The default location for authorized key files is ~/.ssh/authorized_keys and the key has to be in single-line format (everything on one line, and for me, if it was ever in more than 1 line format, you could pretty much abandon all hope at that point of getting it to work).

Also, stupid idea, but you might make sure that the location .ssh/authorized_keys is set as a primary value for the default location for public keys.

Also might check the log files on the server to see if there's any good info.

Your Answer

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