Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using certificate authentication with ssh, the instructions I have found indicate you should create a key-pair as && 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?


share|improve this question
up vote 3 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


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.