Logon failed, use ctrl+c to cancel basic credential prompt.
是不是提交会遇到上述错误,每次远程提交至Github需要重新输入用户名密码,原因是使用HTTPS的提交方式。本文说明通过生成公私钥认证来实现SSH方式远程提交免登录。
cat ~/.ssh/id_rsa.pub
配置用户名和密码
git config --global user.name "hxrui"
git config --global user.email "1490493387@qq.com"
执行以下命令
ssh-keygen -t rsa -b 4096 -C "1490493387@qq.com"
cat ~/.ssh/id_rsa.pub
添加SSH公钥
git remote rm origin
git remote add origin git@github.com:hxrui/youlai-mall.git
验证成功
原文:https://www.cnblogs.com/haoxianrui/p/14251061.html