Git不断要求输入密码 [英] Git keeps asking for password

查看:105
本文介绍了Git不断要求输入密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索并搜索了几个小时,找到了解决这个问题的方法,但我没有尝试过。让我先介绍一下这一点,虽然我之前使用过* nix,但我几乎是一个小菜鸟,所以我确定我错过了某处某处设置Git的步骤。

我在网络上设置了一个Ubuntu盒子,用于托管我们的新Git仓库。该框正在运行Git,Gitosis和ViewGit。一切似乎都设置正确,我可以查看我添加到ViewGit里面的回购。问题是当我通过Windows中的TortoiseGit克隆repo时。当我输入git@10.10.0.144:/home/git/Plugins/.git/的地址时,它会自动要求linux机器上的git用户的密码。我可以将此地址从git @更改为系统上的任何其他用户名,并且还会要求该用户的密码。在任何情况下,输入该用户的密码都会将repo克隆到本地系统。另外,分支,放入和拉取也会要求输入密码,并且如果输入了一切正常的功能。

我在窗口框中创建了RSA pub文件,我试过了(通过git bash)并将它们存储在gitosis的keydir文件夹中,并且添加了用户gitosis.conf文件(rsa文件的名称减去.pub)。我也修改了我的sshd_config文件,在系统中包含AllowUsers git和我的用户名。我感到茫然,似乎并不是一个好主意,可以给我想要访问此存储库的每个人提供服务器IP地址,用户名和密码,以便他们可以下载一些代码。感谢您的帮助!

解决方案最近我有同样的问题:我可以从Cygwin克隆/推送到我的gitosis管理的回购,但TortoiseGit不停地询问git用户的密码(git@192.168.1.30)。

最后,我可以通过重新安装TortoiseGit来使其工作(我选择了Plink选项在安装时),然后在TortoiseGit设置上,进入网络> SSH客户端并将值更改为您的Cygwin ssh二进制文件(即C:\cygwin\bin\ssh.exe)。



通过改变这一点,我能够完成TortoiseGit的所有操作,并且我被要求输入密码,这是我在Cygwin上定义的SSH密钥。



另外,请检查您的gitosis.conf是否包含Cygwin可见的公钥,并删除.pub扩展名:如果我的Cygwin安装程序显示我是 myuser @ myhost , gitosis.conf中的相关条目应该是 myuser @ myhost ,并且该文件带有公钥s应该在 keydir / myuser@myhost.pub


I've searched and searched, for what seems like hours, for a solution to this problem and nothing I've tried works. Let me preface all this by saying that while I've used *nix before, I'm pretty much a noob so I'm sure I missed a step in the setup of Git somewhere.

I set up a Ubuntu box on the network at work to host our new Git repo. The box is running Git, Gitosis, and also ViewGit. Everything seems to be set up correctly, and I can view the repo I've added inside of ViewGit. The problem is when I go to clone the repo via TortoiseGit in Windows. When I type in the address of "git@10.10.0.144:/home/git/Plugins/.git/" it automatically asks for the password for the "git" user on the linux box. I can change this address from "git@" to any other username on the system and it will also ask for the password for that user. In any case, entering the password for that user continues the clone of the repo to the local system. Also branching, puts, and pulls will also ask for a password, and if entered everything functions properly.

I've created the RSA pub file on the windows boxes I've tried this on (via the git bash) and stored them in the keydir folder of gitosis, as well as adding the users gitosis.conf file (the name of the rsa file minus the .pub). I've also modified my sshd_config file to include "AllowUsers git" and also my username on the system. I'm at a loss, doesn't seem like a good idea to give everyone who I want to have access to this repository the server IP address, a username, and then the password to that username just so they can download some code. Thanks for the help!

解决方案

I had the same problem recently: I could clone/push to my gitosis-managed repo from Cygwin, but TortoiseGit kept asking for the password of the git user (git@192.168.1.30).

Finally I could make it work by reinstalling TortoiseGit (I selected the Plink option at install time), then on the TortoiseGit settings go to Network > SSH Client and change the value to your Cygwin ssh binary (ie. C:\cygwin\bin\ssh.exe).

By changing this I was able to do all the operations from TortoiseGit, and I'm asked for the password the SSH key which I defined on Cygwin.

Also, check that your gitosis.conf contains the public keys which are visible to Cygwin, removing the ".pub" extension: if my Cygwin install shows that I'm myuser@myhost, the associated entry on gitosis.conf should be myuser@myhost and the file with the public key should be on keydir/myuser@myhost.pub

这篇关于Git不断要求输入密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆