使用ssh-key无需密码即可推送到github [英] Push to github without password using ssh-key
问题描述
我生成了一个没有密码的密钥对,并将公钥添加到github。
与
user @ dev:/ var / www / project#ssh -T git@github.com
您好用户!您已成功通过身份验证,但GitHub不提供shell访问权限。
成功,当我重命名密钥时,它失败。
但是当我想推送我的更改时,它仍然要求我提供我的用户名/密码组合。
有没有无需密码推送的方法?如果它要求输入用户名和密码,则您的原始远程用户将指向https网址而不是ssh网址。
将其更改为ssh。
例如,像git这样的github项目将会有https url https://github.com/<Username>/<Project>.git
和ssh之一:
git@github.com:<用户名> /< Project> .git
你可以这样做:
git remote set-url origin git@github.com:<用户名> /< Project> ;. git
更改网址。
I generated a key-pair without password and added the public-key to github. Connection with
user@dev:/var/www/project# ssh -T git@github.com
Hi User! You've successfully authenticated, but GitHub does not provide shell access.
was successful and when i rename the key, it fails. But when I want to push my changes, it stills ask me for my Username/Password combination.
Is there a way to push without password?
If it is asking you for a username and password, your origin remote is pointing at the https url rather than the ssh url.
Change it to ssh.
For example, a github project like Git will have https url
https://github.com/<Username>/<Project>.git
and the ssh one:
git@github.com:<Username>/<Project>.git
You can do:
git remote set-url origin git@github.com:<Username>/<Project>.git
to change the url.
这篇关于使用ssh-key无需密码即可推送到github的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!