0

I have generated a public key file (id_rsa.pub) and a private key file (id_rsa) and placed them in my ~/.ssh folder

According to the server admin, he has already added "my key" to the server for accessing it.

Could someone please clarify :

  • when he says he has added my "key". Is that the public key that he has added or private key ? I was under the impression that private keys are not supposed to be distributed but only public keys are supposed to be sent. Then why did the server admin ask for my private key ?

  • I tried connecting to the server using an ~/.ssh/config file with the entry for IdentityFile as the id_rsa key (private key). I got an error as follows : Permission denied (publickey). Does this mean it was hoping i'd send a public key rather than a private key ?

  • Is it possible to identify public keys and private keys by merely looking at them ? Are they of specific lengths ?

1
  • 1
    Do not give out your private key! If he asked for that, then he was asking for the wrong thing.
    – Zoredache
    Oct 18, 2012 at 18:36

1 Answer 1

1
  • The server admin only needs the public key.
  • If StrictModes yes is enabled in sshd_config you have to check the permissons of the id_rsa file.
  • When you have created the key, you have specified a length. This is the length of the private key in bits.

With the ssh -v option, ssh print debugging messages like this:

$ ssh -v user@server
# ...
# debug1: identity file /Users/you/.ssh/id_rsa type -1
# debug1: identity file /Users/you/.ssh/id_rsa-cert type -1
# debug1: identity file /Users/you/.ssh/id_dsa type -1
# debug1: identity file /Users/you/.ssh/id_dsa-cert type -1
# ...
# debug1: Authentications that can continue: publickey
# debug1: Next authentication method: publickey
# debug1: Trying private key: /Users/you/.ssh/id_rsa
# debug1: Trying private key: /Users/you/.ssh/id_dsa
# debug1: No more authentication methods to try.
# Permission denied (publickey).

Hope this helps.

You must log in to answer this question.

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