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?

link|improve this question

72% accept rate
feedback

1 Answer

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.

link|improve this answer
2  
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 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? – duperuser Jan 17 at 1:11
feedback

Your Answer

 
or
required, but never shown

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