- Create the ssh public key using this command in the terminal, enter the command and follow all the presented steps
ssh-keygen -t ed25519 -C <account_email>
- Terminal will show the path of the file which has the public key in your system, copy that path and open it.
cat <file_path> ## ~/.ssh/id_ed25519.pub
- You'll see the key, copy all the file content and go to this page
https://github.com/settings/keys
and clickNew SSH key
. - In the opened page, use any understandable title, use
Authentication Key
as key type, and add the copied key to the key box. - Add your commits user name and password using these two commands:
git config --global user.name <account_name> ## use quotations to use space in the name git config --global user.email <account_email>
- Clone any of your repos to check that everything is ok.
For using more than one account on the same machine, check this gist: https://gist.github.com/rahularity/86da20fe3858e6b311de068201d279e3.
Notes:
- Remember to use
ed25519
algorithm while creating the key notrsa
. - Don't use
-k
while adding keys to the ssh-agent on linux.