github|gitee配置git信息+ssh免密
发布日期:2021-05-07 22:42:13 浏览次数:25 分类:精选文章

本文共 2013 字,大约阅读时间需要 6 分钟。

github|gitee配置git信息+ssh免密

总览

1、配置用户名:	git config --global user.name "kong"2、配 置 邮 箱:	git config --global user.email "xxxx@qq.com"3、ssh免密登陆:	ssh-keygen -t rsa -C "xxxx@qq.com",之后按3次回车。4、查看:	cat ~/.ssh/id_rsa.pub5、把id_rsa.pub内容复制到:gitee --> 安全设置 --> SSH公钥 --> 添加公钥 --> 把id_rsa.pub内容粘贴进来。6、测试:	ssh -T git@gitee.com || ssh -T git@github.com	,输入yes,以后提交代码就不用输入账号密码

开始配置

我是Linux端、window端:鼠标右键git bash设置, 下面的输入指令一样

kong@k:~$ git config --global user.name "kong"		,这里随便取kong@k:~$ git config --global user.email "241xxxx@qq.com"	,这里是邮箱kong@k:~$ ssh-keygen -t rsa -C "241xxxx@qq.com"		,创建ssh免密Generating public/private rsa key pair.Enter file in which to save the key (/home/kong/.ssh/id_rsa): 	,回车Enter passphrase (empty for no passphrase): 	,回车Enter same passphrase again: 	,回车Your identification has been saved in /home/kong/.ssh/id_rsa.Your public key has been saved in /home/kong/.ssh/id_rsa.pub.The key fingerprint is:		,回车SHA256:mUPV7LiWH0o7x....CkfUXw 241xxxx@qq.comThe key's randomart image is:+---[RSA 2048]----+|          .o     ||         o=..=.B+||        ...oo = o|+----[SHA256]-----+'kong@k:~$ cat ~/.ssh/id_rsa.pubssh-rsa AAAAB3NzaC1yc2EQx..省略..PYJRhk/QlgmuB 241xxxx@qq.comkong@k:~$ ssh -T git@gitee.comThe authenticity of host 'gitee.com (212.xx.62.xxx)' can't be established.'ECDSA key fingerprint is SHA256:FQGC9Kn/eye1......mjey0Wc.Are you sure you want to continue connecting (yes/no)? yes		,输入yes,以后提交代码就不用输入账号密码Warning: Permanently added 'gitee.com,212.xx.62.xxx' (ECDSA) to the list of known hosts.Hi xxxx! You've successfully authenticated, but GITEE.COM does not provide shell access.'kong@k:~$ ssh -T git@github.comThe authenticity of host 'github.com (192.xx.xx.xx)' can't be established.'RSA key fingerprint is SHA256:nThbg6kX.....w6E5SY8.Are you sure you want to continue connecting (yes/no)? yes		,输入yes,以后提交代码就不用输入账号密码Warning: Permanently added 'github.com,192.xx.xx.xxx' (RSA) to the list of known hosts.Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access.'
上一篇:linux ll:未找到命令
下一篇:idea连接Linux与文件上传

发表评论

最新留言

很好
[***.229.124.182]2025年04月08日 05时17分01秒