git clone gitosis@host:gitosis-admin.git 的密码问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1005947/
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
password problem with git clone gitosis@host:gitosis-admin.git
提问by
I'm confronted with some problems when trying to configure gitosis on Ubuntu. When i run this command
我在尝试在 Ubuntu 上配置 gitosis 时遇到了一些问题。当我运行此命令时
git clone gitosis@host:gitosis-admin.git
For my local machine i used git clone [email protected]:gitosis-admin.git
where 59.80.70.68 is the ip of the server. But I get a password problem. I tried entering password of the server machine, but it fails
对于我的本地机器,我使用git clone [email protected]:gitosis-admin.git
59.80.70.68 是服务器的 ip。但是我遇到了密码问题。我尝试输入服务器机器的密码,但失败
Kindly help me.
请帮助我。
回答by Phil Miller
Gitosis never works with passwords. It always uses SSH keys. You need to configure the use of whatever public key goes with the private key you gave it when you ran gitosis-init. You would do this by editing ~/.ssh/config
to include a stanza like
Gitosis 从不使用密码。它始终使用 SSH 密钥。您需要配置使用您在运行 gitosis-init 时提供的私钥的任何公钥。您可以通过编辑~/.ssh/config
以包含像这样的节来做到这一点
Host githost # hostname you use on the commandline, in git remotes, etc.
HostName 12.34.56.78 # actually IP address or DNS name to connect to
User gitosis
IdentityFile ~/.ssh/id_rsa # whatever file stores the private key matching the public key you gave gitosis
回答by gaspard
I had a similar problem: I could push from a laptop but not from a linux box.
我有一个类似的问题:我可以从笔记本电脑推送,但不能从 linux 盒子推送。
Looking at the logs on the server, I saw:
查看服务器上的日志,我看到:
Public key b3:f3:... from <SOME IP> blacklisted (see ssh-vulnkey(1))
The problem comes from old versions of openssl generating bad (not random enough) keys on my old linux box. Since I cannot upgrade (embedded development), I generated both the public and private keys on another machine and copied them to the linux box. Once the new public key was in the "keydir" from gitosis-admin, everything worked fine.
问题来自旧版本的 openssl 在我的旧 linux 机器上生成坏的(不够随机)密钥。由于我无法升级(嵌入式开发),我在另一台机器上生成了公钥和私钥,并将它们复制到linux盒子。一旦新的公钥在 gitosis-admin 的“keydir”中,一切正常。
回答by Dan
I ran into this problem on Windows 7 using Git Bash on top of Cygwin.
我在 Windows 7 上使用 Git Bash 在 Cygwin 上遇到了这个问题。
The issue was that my SSH client was not the one installed with Git (I also have Tortoise SVN installed which installs its own SSH client).
问题是我的 SSH 客户端不是与 Git 一起安装的客户端(我还安装了 Tortoise SVN,它安装了自己的 SSH 客户端)。
You can check the value of $GIT_SSH this should be set to the SSH binary installed with git not some other client (like one that comes with Tortoise SVN/Git).
您可以检查 $GIT_SSH 的值,这应该设置为与 git 一起安装的 SSH 二进制文件,而不是其他一些客户端(例如 Tortoise SVN/Git 附带的那个)。
To do so in Cygwin run echo $GIT_SSH
it should be something like "C:\Program Files\Git\bin\ssh.exe"
if it is not you can update its value in your environment variables
要在 Cygwin 运行中这样做,echo $GIT_SSH
它应该是这样的,"C:\Program Files\Git\bin\ssh.exe"
如果不是,您可以在环境变量中更新其值
(On Windows 7: Start->Right click on 'Computer' -> Properties -> Advanced system settings -> Environment Variables -> Select 'GIT_SSH' -> click 'Edit...' -> Enter the path to ssh.exe for 'Variable value:'.
(在 Windows 7 上:开始-> 右键单击“计算机”-> 属性-> 高级系统设置-> 环境变量-> 选择“GIT_SSH”-> 单击“编辑...”-> 输入 ssh.exe 的路径对于“变量值:”。
回答by lurscher
i had this problem because i wanted to store .ssh/id_dsa somewhere else, git seems by default to look for the identity on your folder, but i haaven't found a way to specify a path to search for it
我遇到这个问题是因为我想将 .ssh/id_dsa 存储在其他地方,git 似乎默认在您的文件夹中查找身份,但我还没有找到指定路径来搜索它的方法
回答by John
The "Setup gitosis management repository" in this post may help:
这篇文章中的“设置 gitosis 管理存储库”可能会有所帮助: