我打开一些问题,我有点问过之前,但现在问题似乎是相当链接到ssh
。SSH连接到GIT失败
- 我在
/home/myuser/gitlab
中安装了Gitlab。 - 我创建了一个代表
test
- 以下说明中,我添加了一个远程
[email protected]:root/testing.git
(Gitlab
的服务器在端口3000上运行)。现在,当我尝试推,我收到此错误信息:
$ git push -u origin master
ssh: Could not resolve hostname mylocalhost: nodename nor servname provided, or not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
现在,我发现有一个问题,我的SSH连接。这是我的/home/myhome/.ssh/config
文件
Host mylocalhost
Hostname localhost
PORT 3000
User git
IdentityFile /home/myuser/.ssh/id_rsa.pub
当我运行ssh mylocalhost
我得到这个消息
ssh_exchange_identification: Connection closed by remote host
冗余模式,似乎连接正确的端口上建立,但这里的porcess失败debug1: ssh_exchange_identification: HTTP/1.1 400 Bad Request
。 我试图更新我的/System/Library/LaunchDaemons/ssh.plist
(我正在使用OSX
)转发端口收听3000
但后来Gitlab
Webrick
Rails
服务器将不再运行。 L试图改变git remote set-url origin mylocalhost:testing.git
[git remote add with other ssh port](http:// stackoverflow.com/questions/3596260/git-remote-add-with-other-ssh-port) – Joe