ssh-add will not accept passphrase

2.6k views Asked by At

I am attempting to setup a SSH connection to github on Windows 10 with the latest version of git for windows. I have created the ssh key and added it to github on their website. I then issue the following commands in git-bash:

eval `ssh-agent`
ssh-add /C/Users/someone/ssh/id_rsa

ssh-add prompts me for the passphrase but rejects every attempt to enter it, either by typing it or by pasting it. Are there any limitations on special characters that can be used for the passphrase, or is something else the problem?

1

There are 1 answers

0
LightBender On

According to the ssh-keygen man page (emphasis mine)

The passphrase may be empty to indicate no passphrase (host keys must have an empty passphrase), or it may be a string of arbitrary length. A passphrase is similar to a password, except it can be a phrase with a series of words, punctuation, numbers, whitespace, or any string of characters you want. Good passphrases are 10-30 characters long, are not simple sentences or otherwise easily guessable (English prose has only 1-2 bits of entropy per character, and provides very bad passphrases), and contain a mix of upper and lowercase letters, numbers, and non-alphanumeric characters.

That being said, sticking inside the standard ASCII character set might save you some trouble by avoiding any encoding-related quirkiness. Generally speaking, a longer password with a variety of character classes works better than using a couple of obscure characters in a shorter password anyway.

Also note that if you create your passphrase on the command line, you need to be conscious of reserved characters and escape them if necessary.