赞
踩
// 生成ssh 私钥-公钥 1. ssh-keygen -t ed25519 -f ~/.ssh/ed25519_filename 2. 将 ~/.ssh/ed25519_filename.pub 文件内容添加到github->user->profile->ssh->add 3. 配置 .ssh/config 根据不同host选择指定ssh-key // .ssh/config 内容如下: Host github.com HostName github.com AddKeysToAgent yes IdentityFile ~/.ssh/ed25519/id_ed25519 Host gitee.com HostName gitee.com AddKeysToAgent yes IdentityFile ~/.ssh/rsa/id_rsa // 启动本机ssh-agent 4. eval "$(ssh-agent)" // 查询当前ssh identify 列表 5. ssh-add -l // 添加 ssh-identify 6. ssh-add ~/.ssh/rsa(rsa私钥文件) 7. cat ~/.ssh/ed25519/id_25519.pub 8. 将 id_25519.pub公钥文件的内容复制到 github.com ->self->settings-> ssh ->add // ssh 测试github配置 9. ssh -T git@ssh.github.com --> Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access. // 至此表示配置成功
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。