You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
查看是否已经有了ssh密钥:cd ~/.ssh
如果没有密钥则不会有此文件夹,有则备份删除
生存密钥: ssh-keygen -t rsa -C “haiyan.xu.vip@gmail.com”
按3个回车,密码为空。 Your identification has been saved in /home/tekkub/.ssh/id_rsa. Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub. The key fingerprint is: ………………
最后得到了两个文件:id_rsa和id_rsa.pub
添加密钥到ssh:ssh-add 文件名,需要之前输入密码.
场景问题
今天把家里的电脑拿来用,我自己在这台电脑上提交代码,报Permission denied的错误
问题解决步骤
1.设置Git的user name和email
git config --global user.name "yourname"
git config --global user.email "youremail"
2.生成SSH密钥
查看是否已经有了ssh密钥:cd ~/.ssh
如果没有密钥则不会有此文件夹,有则备份删除
生存密钥:
ssh-keygen -t rsa -C “haiyan.xu.vip@gmail.com”
按3个回车,密码为空。
Your identification has been saved in /home/tekkub/.ssh/id_rsa.
Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.
The key fingerprint is:
………………
最后得到了两个文件:
id_rsa
和id_rsa.pub
添加密钥到ssh:ssh-add 文件名,需要之前输入密码.
在github上添加ssh密钥,这要添加的是“id_rsa.pub”里面的公钥。
打开https://github.com/,在设置中添加密钥
到这,问题还没解决
git push
还是 还是报拒绝的错误3.查看账号信息
git config --list
返回的信息也是正确的4.验证权限
ssh -T git@githun.com
返回的信息是
Hi lut! You've successfully authenticated, but GitHub does not provide shell access.
5.再一次 设置远程路径
git remote set-url origin git@github.com:tinper-bee/formControl.git
然后再
git push
我的代码 上github上看发现还是原来的账号提交的代码(因之前下载下来的代码是用之前的账号)我在本地代码再做一次修改 然后提交 这次github上的账号显示正常
The text was updated successfully, but these errors were encountered: