- Generate a pair of ssh key
ssh-keygen -t rsa -C "[your_email@example.com]"
To distinguish different keys, I would recommend to identify a specific name to the generated key, such as
id_rsa_azure
- Check the public key
cat ~/.ssh/[your_key_name].pub
Β
For Remote Login
Write the content of public key to
~/.ssh/authorized_keys
of the remote machinevim ~/.ssh/authorized_keys
Β
For GitHub Authentication
- Add the public key to
settings β Access β SSH and GPG keys
- Add the private key to ssh agent
eval "$(ssh-agent -s)"; ssh-add [path/to/your/private/key]
(Optional) Check availability
ssh -vT git@github.com
Β
Done π
Β