how to generate a public key(to be used in GitHub/GitLab) using command line [Git Bash].
The command below generates the error sh.exe": syntax error near unexpected token '('
I am using windows xp.
$ ssh-keygen -t rsa -C "xxxx@gmail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/xxxx/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/xxxx/.ssh/id_rsa.
Your public key has been saved in /c/Users/xxxx/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db xxxx@gmail.com
Here is the command
This will generate a key for you.You have to copy that and insert into your Github's account (just one time).
Steps how to do It
The command to run is only
All the rest beginning with line 2 of your script is the output of ssh-keygen.
And replace you@example.com with your email address.
Have a look at the manual for
ssh-keygen
to look for additional options. You should probably use a longer key by adding-b 4096
to the option list.