Create SSH Keys
Generate key pairs
$ ssh-keygen -t ed25519 -C "your_email@example.com"You can choose another algorithms such as
$ ssh-keygen -t rsa -b 4096
$ ssh-keygen -t ecdsa -b 521To validate key pairs
After adding your public keys, you validate it for example github
$ ssh -T git@github.comNote
For Windows user, make sure your ssh-agent is running.
You can open Windows PowerShell and check it by command below.
Get-Service ssh-agentIf it is not running you can set it at Services App
Adding multiple account
$ nano ~/.ssh/configadded information of your account
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_account1
Host github.com-account2
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_account2You can test and establish the connection through
$ ssh -T git@github.com-account2For account1, you can use as normal or as your main account
For account2, remember to replace "github.com" with "github.com-account2", for example
$ git clone git@github.com-account2:<your_username>/<your_repo>.gitReferences
Last updated