Reputation: 105
I am tying to generate a SSH key on Git, but I'm stuck in the passphrase part: I'm unable to type it. The passphrase field appears without any characters, even though I'm typing them.
$ ssh-keygen -t ed25519 -C "my_email@email.com"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/c/Users/me/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Passphrases do not match. Try again.
As you can see, I can't type anything. There are some similar questions where people say that the text is hidden, but that tecnically you can still type it. The thing is that Git says that the passphrase is not matching on both fields, even though I'm tecnically typing the same characters on both of them. Im on Windows 10, with the latest 64 bits Git release installed.
Just to make it clear, this is my goal:
Create a SSH key so I do not need to type my GitHub credentials every time I want to push files to to my GitHub repo.
Upvotes: 2
Views: 5602
Reputation: 19
I have experienced the same problem as the user @montw today when I was trying to create my first SSH key to attempt an SSH clone for a repo on GitHub. However, unlike @montw, when I tried the suggestions from @torek, I realize that even when I attempted hitting "enter" key twice (essentially attempting to opt for the no passphrase case), git bash still prompts that "Passphrases do not match. Try again.".
Next I tried the second suggestion here by @VonC. This time I encountered a new error message stating I do not have permission to write the file I was creating to save the key in. At that point I realized my working directory must not be one that I have write permit in.
When I switched my working directory back to C:/Users/MyUserName, and attempted the
'ssh-keygen -t ed25519 -C "my_email@email.com"'
command again, I no longer had problems using an empty passphrase or typing an actual passphrase. The passphrase did not display (nor did any masking characters showing its length), but the keys were successfully generated both with and without a passphrase.
Upvotes: 0
Reputation: 1328912
An alternative would be, in a CMD, to type the passphrase directly.
ssh-keygen -t rsa -q -f yourFile -N "<your passphrase>"
(Tested in a CMD with W10, and a %PATH%
referencing C:\Program Files\Git\usr\bin
, where ssh-keygen.exe
is)
If you do not want to set a passphrase:
ssh-keygen -t rsa -q -f yourFile -P ""
In both case, the goal is to not have to type any ENTER: no prompt to answer.
Upvotes: 2
Reputation: 105
As said by @torek:
press ENTER (or RETURN or whatever the key is labeled) on your keyboard twice, so that you are using the no-passphrase case [...]
It worked!
Upvotes: 1