简体   繁体   English

git ssh使用gitlab要求输入密码

[英]git ssh ask for a password with gitlab

I have recently installed on my Ubuntu dedicated a Gitlab server. 我最近在我的Ubuntu上安装了专用的Gitlab服务器。

Webapp is working fine, I had no trouble during the installation (tested on VM before production environment) Webapp运行正常,安装过程中没有问题(在生产环境之前在VM上进行了测试)

I have uploded my ssh rsa private key from the web app on my account, and created a project, clone from another repository. 我从帐户上的Web应用程序升级了ssh rsa私钥,并创建了一个项目,并从另一个存储库克隆。

From my desktop environment, I have tried to git pull using ssh. 在我的桌面环境中,我尝试使用ssh进行git pull。 First login, I had to accept the ssh fingerprint, then, until now server keep asking me to log in as git user, which has no password. 第一次登录时,我必须接受ssh指纹,然后,直到现在,服务器一直要求我以git用户身份登录,该用户没有密码。

D:/drive/project> git pull git@0.0.0.0:me/project.git
git@0.0.0.0's password:
Connection closed by 0.0.0.0
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

D:\skydrive\artmoser>git pull
git@0.0.0.0's password: [tried to type something]
Permission denied, please try again.
git@0.0.0.0's password:
Permission denied, please try again.
git@0.0.0.0's password:
^C

My ssh public and private key under windows is in C:\\Users\\Jack Bauer.ssh On the dedicated server I can see my key in /home/git/.ssh/authorized_keys 我在Windows下的ssh公钥和私钥在C:\\ Users \\ Jack Bauer.ssh中,在专用服务器上,我可以在/home/git/.ssh/authorized_keys中看到我的密钥

I have checked my chmod for user git : 我已经检查了我的chmod用户git:

drwx--x--x  7 git     git     4096 mai   31 05:06 git/
drwx------  2 git  git  4096 juin   1 03:27 git/.ssh/
-rw------- 1 git git  508 juin   1 02:53 git/.ssh/authorized_keys

What am i doing wrong ? 我究竟做错了什么 ?

EDIT 编辑

After more research : 经过更多研究:

If I log in with git user with putty, I receive this error message server refused to allocate pty 如果我使用腻子用git用户登录,则会收到此错误消息, server refused to allocate pty

If I try to do ssh git@0.0.0.0 , they ask for my passphrase, 3 times before git user password (which has none) 如果我尝试执行ssh git@0.0.0.0 ,他们会在git用户密码(没有密码)之前3次要求我输入密码

If I do a ssh tunnel with ssh git@0.0.0.0 -Tvvv , i get this errror at the end of the log 如果我使用ssh git@0.0.0.0 -Tvvv进行ssh隧道,则会在日志末尾出现此错误

debug1: Next authentication method: publickey
debug1: Trying private key: /home/me/.ssh/id_rsa
debug1: key_parse_private2: missing begin marker
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/me/.ssh/id_rsa':

the public key is on my computer, the private is on the server, 公钥在我的计算机上,私钥在服务器上,

If you want to access a server with ssh, your client (here your Windows workstation) must have at least the private keys (and it is a good practice to keep the public keys together with their private keys counterparts). 如果要使用ssh访问服务器,则客户端(在此为Windows工作站)必须至少具有私钥(将公钥和私钥对应的密钥保留在一起是一种很好的做法)。

C:\Users\Jack Bauer\.ssh\id_rsa.pub
C:\Users\Jack Bauer\.ssh\id_rsa

If your keys don't follow this default naming convention, you will need a C:\\Users\\Jack Bauer\\.ssh\\config file (as illustrated there ) 如果您的密钥不遵循此默认命名约定,则需要一个C:\\Users\\Jack Bauer\\.ssh\\config文件(如此处所示

Make sure you have the HOME environment variable set to C:\\Users\\Jack Bauer in your Windows shell when you are typing those command: that is the case if you launch the git-cmd.exe (which comes with any Git For Windows distribution ) 键入这些命令时,请确保在Windows Shell中将HOME环境变量设置为C:\\Users\\Jack Bauer如果您启动git-cmd.exeGit For Windows发行版随附) ,就是这种情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM