//如果没有则提示: No such file or directory //如果有则进入~/.ssh路径下(ls查看当前路径文件,rm删除所有文件)
使用Git Bash生成新的ssh key
1 2 3 4 5 6 7 8 9 10 11 12 13 14
cd ~ #保证当前路径在”~”下 ssh-keygen -t rsa -C "xxxxxx@yy.com"#建议填写自己真实有效的邮箱地址 Generating public/private rsa key pair. Enter file inwhich to save the key (/c/Users/xxxx_000/.ssh/id_rsa): #不填直接回车 Enter passphrase (empty for no passphrase): #输入密码(可以为空) Enter same passphrase again: #再次确认密码(可以为空) Your identification has been saved in /c/Users/xxxx_000/.ssh/id_rsa. #生成的密钥 Your public key has been saved in /c/Users/xxxx_000/.ssh/id_rsa.pub. #生成的公钥 The key fingerprint is: e3:51:33:xx:xx:xx:xx:xxx:61:28:83:e2:81 xxxxxx@yy.com
ssh -T git@github.com The authenticity of host 'github.com(192.30.252.129)' can't be established. RSA key fingerprint is16:27:xx:xx:xx:xx:xx:4d:eb:df:a6:48. Are you sure you want to continueconnecting (yes/no)? yes #确认你是否继续联系,输入yes Warning: Permanently added'github.com,192.30.252.129' (RSA) to the list of known hosts. Enter passphrase for key'/c/Users/xxxx_000/.ssh/id_rsa': #生成sshkye是密码为空则无此项,若设置有密码则有此项且,输入生成ssh key时设置的密码即可。 Hi xxx! You've successfullyauthenticated, but GitHub does not provide shell access. #出现词句话,说明设置成功。