配置账号密码
git config --global user.name "github 用户名"
git config --global user.email "github 邮箱名"
ssh-keygen -t rsa -C "username"
一. 生成密钥
ssh-keygen -t rsa -C "your_email@example.com"
注意:如果你使用的是不支持 Ed25519 算法的旧系统,请使用以下命令:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
2.在以下提示下输入自己设置的安全密码
> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]
3.测试连接
ssh -T git@github.com
config配置
Host github.com HostName
ssh.github.com # 这是最重要的部分
User git Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa