开发者

When I enter ssh-keygen -t rsa -C "your@email.com" in git it gives "Too many arguments" error

开发者 https://www.devze.com 2023-04-03 10:34 出处:网络
Wh开发者_如何学Cen I enter ssh-keygen -t rsa -C \"your@email.com\" in git it gives a \"Too many arguments\" error. How do you solve this issue?

Wh开发者_如何学Cen I enter ssh-keygen -t rsa -C "your@email.com" in git it gives a "Too many arguments" error. How do you solve this issue?

Screenshot

When I enter ssh-keygen -t rsa -C "your@email.com" in git it gives "Too many arguments" error


I also encountered a "Too many arguments" error using this command, but the cause and solution were a little different. I copy and pasted the following command (from an Outlook 2010 email) into the command line:

ssh-keygen –t rsa

and got the error. A coworker suggested just typing the command instead of copy and pasting it. I tried that and it worked, so I must have copy and pasted extra characters by accident (maybe some whitespace or null characters).


It's a typo. You typed -c but wanted (and used in your question) -C

To use -c, the keys have to be already present. Excerpt of man ssh-keygen:

Requests changing the comment in the private and public key files. This operation is only supported for RSA1 keys. The program will prompt for the file containing the private keys, for the passphrase if the key has one, and for the new comment.


For me I was running it in Powershell, the issue was setting the passphrase, I had

ssh-keygen.exe -t rsa -b 4096 -N ""

But needed

ssh-keygen.exe -t rsa -b 4096 -N '""'

note: the issue existed with or without -C

I found my fix on this question.

0

精彩评论

暂无评论...
验证码 换一张
取 消