|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 金刚 于 2020-5-1 23:44 编辑
github配置ssh key
进入任意文件夹,右键,选择Git Bash Here,进入界面,黑户窗口里操作就ok。
qingming_wu@qingming_wu-PC MINGW64 /d
$ ssh-keygen -t rsa -C "qingmingwu_beijing@163.com" (填写自己的github设置的邮箱)
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/qingming_wu/.ssh/id_rsa): (直接回车,不填写路径默认保存显示的路径上,这就是key)
Enter passphrase (empty for no passphrase): (密码填写简单点,因为pull,push经常用)
Enter same passphrase again: (确认密码) (然后显示下面图形界面,表名成功)
Your identification has been saved in /c/Users/qingming_wu/.ssh/id_rsa.
Your public key has been saved in /c/Users/qingming_wu/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:U2HGAQoNFh5g+Z7Ygwm8caK2JElYVDwES3Xvn53GNQ4 qingmingwu_beijing@163.com
The key's randomart image is:
+---[RSA 2048]----+
| .*OX+. .o=. |
| oo+o+.o o.. |
|o...... . . |
|o= .. . . |
|oo=* . S E o |
|+++ = o + = . |
|+ . . o = . |
| . . |
| |
+----[SHA256]-----+
qingming_wu@qingming_wu-PC MINGW64 /d
$ clip < ~/.ssh/id_rsa.pub (命令复制key的文件内容,直接可以黏贴)(也可以手动复制,路径》C:\Users\qingming_wu\.ssh\id_rsa.pub>进入文件复制全部内容)
进入github登录,一次进入,头像》settings》SSH and GPG keys》New SSH key,进入界面,Title随便取,最好英文,Key刚才复制的黏贴出来。最后点击Add SSH key。
qingming_wu@qingming_wu-PC MINGW64 /d
$ ssh -T git@github.com (github与本地是否连接成功)
The authenticity of host 'github.com (13.250.177.223)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes (输入yes)
Warning: Permanently added 'github.com,13.250.177.223' (RSA) to the list of known hosts.
Enter passphrase for key '/c/Users/qingming_wu/.ssh/id_rsa': (忘记密码输入错误了,填写三次机会,这个没关系,三次都失败了,可以重来)
Enter passphrase for key '/c/Users/qingming_wu/.ssh/id_rsa':
Enter passphrase for key '/c/Users/qingming_wu/.ssh/id_rsa':
Permission denied (publickey). (失败的提示)
qingming_wu@qingming_wu-PC MINGW64 /d
$ ssh -T git@github.com (重新检查链接否)
Warning: Permanently added the RSA host key for IP address '52.74.223.119' to the list of kn own hosts.
Enter passphrase for key '/c/Users/qingming_wu/.ssh/id_rsa':
Enter passphrase for key '/c/Users/qingming_wu/.ssh/id_rsa':
Enter passphrase for key '/c/Users/qingming_wu/.ssh/id_rsa': (最后密码成功,提示successfully,yeah,ok)
Hi qingmingwu! You've successfully authenticated, but GitHub does not provide shell access.
qingming_wu@qingming_wu-PC MINGW64 /d
$
操作的图片展示
配置ssh key过程
参考文章视频
https://v.qq.com/x/page/l086146flst.html (视频优先)
https://www.jianshu.com/p/cb85ab83ade1 (文章优先)
https://blog.csdn.net/mrjkzhangma/article/details/89466811 (参考)
|
|