0

我正在使用 heroku 12.04 并尝试运行

$ git push heroku master 

但我得到下一个错误:

ssh: connect to host heroku.com port 22: Connection refused

如果我尝试

$ ssh git@github.com 

我犯了同样的错误

我在这件事上寻找了其他问题,但还没有弄清楚,但这是我检查过的一些事情:

  1. 我安装了 openssh-server

  2. $ service ssh status
    ssh start/running, process 8819

  3. $ service sshd start
    sshd: unrecognized service

  4. $ ssh -vvv localhost
    OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to localhost [127.0.0.1] port 22.
    debug1: connect to address 127.0.0.1 port 22: Connection refused
    ssh: connect to host localhost port 22: Connection refused

  5. 我还尝试将 sshd_config 从端口 22 更改为端口 2222,但我仍然被拒绝端口 2222..

  6. $ sudo netstat -pantu | grep LISTEN
    tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 5691/dnsmasq
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 9081/sshd
    tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1063/cupsd
    tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 1142/postgres
    tcp6 0 0 :::22 :::* LISTEN 9081/sshd
    tcp6 0 0 ::1:631 :::* LISTEN 1063/cupsd

谁能帮帮我吗?

4

4 回答 4

2

在多次尝试生成密钥后,部署 heroku。我删除了我的机器(Ubuntu)的工具带并再次手动安装并添加了一个新密钥。

于 2012-09-09T23:19:59.513 回答
0
于 2013-07-10T11:52:21.130 回答
0

在我通过 ssh 进行备份后,我遇到了这样的问题。

重新启动客户端机器有帮助。

于 2014-01-09T23:14:51.227 回答
0

有时重新打开终端会有所帮助。在 mac sierra 和 high sierra 上,您应该需要在 ~./ssh/config Host * AddKeysToAgent 是 UseKeychain 是 IdentityFile ~/.ssh/id_rsa VerifyHostKeyDNS yes // 添加此行后它开始工作

不要忘记重新打开终端并重试。

于 2018-09-01T19:05:32.160 回答