Option 1
Терминал дээр шалгах
ssh -T git@github.com
Permission denied (public key).
буцааж байвал:
ssh-keygen -t rsa -b 4096 -C "email_or_github_mail@email.com"
Mac дээр:
cat ~/.ssh/id_rsa.pub | pbcopy
Linux дээр:
cat ~/.ssh/id_rsa.pub | xclip -sel clip
copy хийсэн.
Github тохиргоо орон SSH нэмэх SSH Key нэмсэн бол терминал дээр:
ssh -T git@github.com
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Option 2
SSH key within a subdirectory
mkdir -p ~/.ssh/git
ssh-keygen -t ed25519 -C "email_or_github_mail@email.com" -f ~/.ssh/git/github
cat ~/.ssh/git/github.pub | xclip -sel clip
Add key to Githubkey
# create config
vi ~/.ssh/config
# add
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/git/github
Test connection
ssh -T git@github.com