web-dev-qa-db-ja.com

SSH:リモートサーバーによって接続が閉じられました

リモートサーバーにsshログインしようとしています。しかし、sshコマンドを使用してターミナルからログインしようとするたびに:

  ssh root@{ip_address}

エラーが発生します:

 Connection closed by {ip_address}

ホストの拒否とホストの許可を確認しましたが、ファイルには何もありません。なぜそれが起こっているのかわかりませんか?

ワークステーションを変更し、キーが変更されたときに発生しました。 sshログインを試したところ、キーを追加するように求められ、yesと入力して接続を閉じました。

もう一度sshに接続する方法はありますか?

よろしくお願いします。

ありがとうございました。

編集:

Ssh -v -v -v -v root @ {ip_address}の出力は

OpenSSH_5.9p1 Debian-5ubuntu1.1, 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 {ip_address} [{ip_address}] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/mona/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/mona/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/mona/.ssh/id_rsa-cert type -1
debug1: identity file /home/mona/.ssh/id_dsa type -1
debug1: identity file /home/mona/.ssh/id_dsa-cert type -1
debug1: identity file /home/mona/.ssh/id_ecdsa type -1
debug1: identity file /home/mona/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for Host "{ip_address}" from file "/home/mona/.ssh/known_hosts"
debug3: load_hostkeys: loaded 0 keys
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 151.236.220.15
13
user2206724

同じ問題がありましたが、単純なリモートサーバーの再起動が役立ちました。

4
Aistis

サーバーがSSH経由のrootログインを許可していることを確認しますか?そうでない場合は、特にサーバーのSSHポートにインナーネット全体からアクセスできる場合は、ルートログインを有効にする代わりに、Sudo特権を持つ別のアカウントを使用することをお勧めします。

3
Kimvais

SSH接続の1つで、同じ「接続が{ip_address}によって閉じられました」というエラーが発生しました。通常の解決策をすべて試しましたが、何もうまくいきませんでした。最後に、ホスト上の~/.ssh/authorized_keysファイルが破損していることがわかりました。誰かがファイルにキーを追加しようとしましたが、各行の最後で折り返される埋め込みラインフィードを使用して、キーをコピーして貼り付けました。つまり、3行にまたがる1つの連続した文字列は、実際には3つの個別の文字列(1行に1つ)でした。埋め込まれた改行は行末にあったため、それを見てもわかりませんでした。

問題のキーを削除して自分のキーを追加しました。その後、すべてが期待どおりに機能しました。

1

sudo ssh root @ {ip_address}を試してみてください。

1
Beatrice Lin

私自身も、cloud9エディターでの作業中に同じ問題を抱えていました。鉱山は高いCPU使用率が原因でした。 Apacheの接続を停止すると問題が解決します。

0

FTPサイトへの接続に使用されている名前を確認してください。間違っているか複数の名前が認証のために送信されています。

0
snnpro