When I enter ssh-keygen -t rsa -C "[email protected]" 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.