2013-07-18 33 views
1

我已经安装了GitLab。假设我将它安装在/home/myuser/gitlab推送Gitlab回购时ssh连接失败

  1. 我创建了一个新的项目
  2. 有人告诉我,创造一个回购“测试”我把/home/myuser/gitlab/test
  3. 我加了一些SSH密钥在/home/myuser/.ssh
  4. 然后我/home/myuser/gitlab/test初始化一个Git回购。
  5. 以下说明中,我添加了一个远程[email protected]:root/testing.git 但是当我尝试推,我收到此错误信息:
$ git push -u origin master 
ssh: connect to host localhost port 22: Connection refused 
fatal: Could not read from remote repository. 

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

我在OS X安装GitLab和我有其他的SSH密钥在/home/myhome/.ssh,我已在/home/myuser/gitlab/.git/config内设置了用户电子邮件和名称(并将其设置为全局测试),并从/home/myuser/gitlab启动服务器。有谁知道这个错误来自哪里?

如果我跑ssh [email protected],我得到

/home/myhome/.ssh/config line 4: garbage at end of line; "home". 

凡在这个文件我有另一个项目的远程服务器的一些设置。我认为这是问题,但我不知道如何解决这个问题。

更新:这是我的~/.git/config文件的内容

Host remote_test_server 
Hostname [email protected]_test_server 
IdentityFile ~/.ssh/id_rsa_stf.pub 
User <your home acct> 
+0

@AloisMahdal是的,我认为这是一个烫发问题。我将在运行'ssh -T git @ localhost'时更新我的​​标题 – Newben

回答

1

/home/myhome/.ssh/config线4:垃圾在行尾; “家”。

这会阻止任何ssh命令正常工作,因为远程会话完成寄生回声。

  • 检查.profile或其他.rc文件,并查看是否有回声在那些完成。
    或者至少,使用ssh -T [email protected]进行测试,以禁用任何TTY分配。

  • 还请检查您的.ssh/config文件的内容,该文件似乎没有正确格式化。

看到这个example of a config file

User应该用于rmeote服务器上的SSH会话的帐户的登录名。
它应该而不是是homedir路径。

IdentityFile应该引用私有密钥(~/.ssh/id_rsa_stf),公众一个!

Hostname应引用远程服务器'ftp.remote_test_server',而不是user @ remoteServer。

+0

我收到相同的消息:'/home/myhome/.ssh/config第4行:垃圾在行尾; “home”.' – Newben

+0

@新我编辑了我的答案 – VonC

+0

我已经用'〜/ .ssh/config'文件的内容更新了我的帖子。可以配置多个用户吗?顺便说一下,什么意思'用户<您的家庭acct>'? – Newben