SSH: "Bad passphrase" after generation of public key
Asked Answered
A

1

27

When I execute these commands (setting a passphrase, after the first)...

$ ssh-keygen -t dsa
$ chmod 600 my_key
$ chmod 600 my_key.pub

...and then, to test the passphrase...

$ ssh-add my_key.pub

...I keep getting:

Bad passphrase, try again for my_key.pub:
Bad passphrase, try again for my_key.pub:
Bad passphrase, try again for my_key.pub:
Bad passphrase, try again for my_key.pub:
...

What am I doing wrong?

This is on Ubuntu.

Augustinaaugustine answered 16/12, 2013 at 18:3 Comment(0)
C
75

You're trying to add public key to the agent, that one isn't pass-protected, the private one is. Try adding your private key and it should work.

Carbonize answered 16/12, 2013 at 18:18 Comment(3)
Not just you @tmthyjames... that includes me and 57 others... but, we add public key to the server, but the arg for -i is the private key file, strange enough.Dumortierite
@FaithReaper it’s not strange. Your public key can be used to verify your private key, with which you authenticate. So you distribute the, hence, public part of the key pair, keeping private one to yourself to “certify” that you are you. Simplified :)Carbonize
Yeah.. the process I know well, just the wording. Maybe I am too sensitive about wording :)Dumortierite

© 2022 - 2024 — McMap. All rights reserved.