Add ssh key to gitlab or github
· Lettura di 1 minuto
# 1. generate key-pair (public and private)
ssh-keygen -t ed25519 -C "a comment, usually an email"
# 2. copy public key and put it in gitlab
# windows (with wsl): cd $HOME
cat ~/.ssh/id_ed25519.pub
# 3. add config for specific hostname
nano ~/.ssh/config
# and add:
# minimal
# remote should be:
# git@github.com:path/to/repo.git
Host github.com
IdentityFile C:\\Users\\<username>\\.ssh\\id_ed25519
# some options
Host github.com
User git
HostName ssh.github.com
Port 443
IdentityFile C:\\Users\\<username>\\.ssh\\id_ed25519