Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When using certificate authentication with ssh, the instructions I have found indicate you should create a key-pair as id_rsa.pub && id_rsa. The public key is then sent to the remote system to be added to authorized_keys (or authorized_keys2 frequently in the case of OS/X). Obviously, the originating system needs access to its private key id_rsa.

I recently broke this by renaming the id_rsa file and fixed it by restoring the file to its original name; so presumably, ssh uses the file ~/.ssh/id_rsa. Is this correct? Is it configurable? I had presumed that I would use different private keys for different remote systems, to limit the impact of a compromised private key; is this simply impractical, and it's better to just re-use a single private key?

Thanks.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

ssh uses the ~/.ssh/id_rsa key by default, but you can use the -i command line argument to specify a different identity file to use.

share|improve this answer
    
ssh user@server -p [port] -i [/path/to/key] –  Rob Mar 29 '12 at 18:50
    
You an also change this via the IdentitiyFile setting in ~/.ssh/config or /etc/ssh/ssh_config , even on a per-host basis. Read man ssh_config for more information. –  jofel Mar 29 '12 at 19:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.