CodeMist

SSH Tips

· 56 words · 1 minutes to read
Categories: dev
Tags: ssh tips macOS

Some useful tips of SSH.

  • generate ssh for GitHub/GitLab

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

ssh-keygen -t ed25519 -C "yourname@mail.com"

in ssh config ($HOME/.ssh/config)

Host username-github.com # ssh -T git@username-github.com
    HostName github.com
    PubkeyAuthentication yes
    IdentityFile ~/.ssh/keys/id_ed25519

Add ssh public key to github/gitlab ssh key in setting.

Add ssh key to macOS keychain

ssh-add --apple-use-keychain ~/.ssh/id_ed25519

Test ssh key

ssh -T git@username-github.com