我正在打开一些我之前问过的问题,但现在这个问题似乎与ssh
.
- 我已经在
/home/myuser/gitlab
. - 我创建了一个代表
test
- 按照说明,我添加了一个远程
git@localhost: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
在详细模式下,似乎在正确的端口上建立了连接,但进程在此处失败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