Generate SSH key using below command
ssh-keygen -trsa -C [email protected]
just hit enter to apply the default value for all the inputs it asks
the output will be
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
/home/user/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa
Your public key has been saved in /home/user/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [email protected]
The key's randomart image is:
+---[RSA xxxx]----+
| ..++xX*Ox |
| x..xx/+.x. + . |
|.. +..*+xx x + |
|... +x+o x. |
|x.. + +..x |
|xx.. x |
|... |
|x x |
|x x. |
+----[SHA256]------+
just use the cat command to log the ssh key file contents on the terminal(use your own path here).
cat /home/user/.ssh/id_rsa.pub
the output will be
ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [email protected]
copy the contents and go to your github account go to settings under Account settings>SSH and GPG keys click on New SSH key, provide the name you wish and paste the copied contents in the value and save. that's it you are ready to commit your changes without using username, password every time.
bashscript but usingshinstead. See Difference between sh and bash-t ed25519has been enough better that it's now the default and strongly preferred type. It delivers better security with shorter keys and shorter signatures that are faster to use and check. To match the security ed25519 delivers with 256-bit keys you need 4096 bits of RSA key.