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

What is the purpose of passphrase when I generate public and private keys using ssh-keygen?

I'm fairly new to all the SSH business. I have some basic idea about that using SSH public and private keys allows me to be identified and authorized by remote SSH server without having to have a password transferred over the Internet. But when I generate the keys, it also offers to type in optionally a passphrase. What is this passphrase for? What is the pros and cons to use it?

share|improve this question
up vote 2 down vote accepted

To encrypt your keys. So if an attacker get's your private/public key, it can't do anything with them.

share|improve this answer
To amplify: Imagine you have the private-key pair on a laptop. You lose the laptop. A thief gets access to your private key and can impersonate you and access all the computers you have access to. A passphrase helps to prevent this. – RedGrittyBrick Jan 15 '12 at 9:42
If I store the private key file on a USB drive which is shared with some friends sometimes, do I need to further protect the file or is the passphrase sufficient? – qazwsx Jan 17 '12 at 1:11

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.