git clone 询问密码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24120871/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 18:10:26  来源:igfitidea点击:

Git clone ask for password

gitauthenticationssh

提问by Giorgio

I have followed this how-to to configure a GIT server in my VPS server: http://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-Server

我已按照此操作方法在我的 VPS 服务器中配置 GIT 服务器:http: //git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-Server

but each time I try to clone from my workstation (I generated key and added to authorized_keys) it asks me for GIT user password!

但是每次我尝试从我的工作站克隆(我生成密钥并添加到authorized_keys)时,它都会要求我输入 GIT 用户密码!

Why? how can I fix it?

为什么?我该如何解决?

thanks

谢谢

回答by stefanglase

You are cloning from an http URL which will not use your SSH keys and ask for your password. You can either clone using a SSH connection or install password caching. GitHub has nice instructions to set this up: https://help.github.com/articles/set-up-git#password-caching

您正在从一个 http URL 进行克隆,该 URL 不会使用您的 SSH 密钥并要求您输入密码。您可以使用 SSH 连接进行克隆或安装密码缓存。GitHub 有很好的设置说明:https: //help.github.com/articles/set-up-git#password-caching