Host github.com
User YourEmail(你的邮箱)
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
再次执行
Text Only
1
ssh -T git@github.com
会出现以下提示,输入 yes 回车即可
Text Only
1234
The authenticity of host '[ssh.github.com]:443 ([192.30.255.123]:443)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[ssh.github.com]:443,[192.30.255.123]:443' (RSA) to the list of known hosts.
再次执行ssh -T git@github.com,发现验证通过
Text Only
1
Hi Clare! You've successfully authenticated, but GitHub does not provide shell access.
# For the account1
Host github_account1
HostName ssh.github.com
PreferredAuthentications publickey
Port 443
User git
IdentityFile ~/.ssh/id_rsa_account1
# For the account2
Host github_account2
HostName ssh.github.com
PreferredAuthentications publickey
Port 443
User git
IdentityFile ~/.ssh/id_rsa_account2