
以前は、次のコマンドを使用して OpenSSH でサーバーに接続していました。
ssh [email protected]
しかし、現在場所を変更したため、接続できなくなりました。コマンド-v
でパラメータを使用した場合のデバッグ レポートは次のとおりですssh
。
ssh [email protected] -v
OpenSSH_6.0p1 Debian-3ubuntu1, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /home/riless/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to my-server.com [xx.xxx.xxx.xx] port 22.
debug1: Connection established.
debug1: identity file /home/riless/.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/riless/.ssh/id_rsa-cert type -1
debug1: identity file /home/riless/.ssh/id_dsa type -1
debug1: identity file /home/riless/.ssh/id_dsa-cert type -1
debug1: identity file /home/riless/.ssh/id_ecdsa type -1
debug1: identity file /home/riless/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-3ubuntu1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
しばらくすると、次のように出力されます。
Connection closed by xx.xxx.xxx.xx
注: PuTTY は正常に動作しますが、OpenSSH は動作しません。私は Ubuntu を使用しています。
編集1: ファイルの内容/etc/ssh/ssh_config
(コメント行を除く):
Host *
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
/home/riless/.ssh/config
ファイルの内容:
Host xx.xxx.xxx.xx
User root
Port 22
Hostname xx.xxx.xxx.xx
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
IdentitiesOnly yes
編集2: 次のコマンド ラインを使用して暗号を変更しようとすると:
ssh [email protected] -c aes256-ctr -v
パスワードの入力を求められますが、その直後にコンソールがフリーズします。
[email protected]'s password:
debug1: Authentication succeeded (password).
Authenticated to xx.xx.xx.xxx ([xx.xx.xx.xxx]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LC_PAPER = fr_FR.UTF-8
debug1: Sending env LC_ADDRESS = fr_FR.UTF-8
debug1: Sending env LC_MONETARY = fr_FR.UTF-8
debug1: Sending env LC_NUMERIC = fr_FR.UTF-8
debug1: Sending env LC_TELEPHONE = fr_FR.UTF-8
debug1: Sending env LC_IDENTIFICATION = fr_FR.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_MEASUREMENT = fr_FR.UTF-8
debug1: Sending env LC_TIME = fr_FR.UTF-8
debug1: Sending env LC_NAME = fr_FR.UTF-8
答え1
/root/.ssh/authorized_keys ファイル内の root ユーザーのソース接続に制限が設定されている可能性があります。
具体的には、おそらくauthorized_keys
次のようになります。
from="trusted.host.some.domain.ext,10.0.0.*,:*.untrusted.network.ext" ssh-rsa [your key] root@localhost
接続が「from」パターンと一致しない場合、またはそのパターンから明示的に除外されている場合、接続は拒否されます。
答え2
多くのフォーラムを参照して、1 行追加しました/etc/ssh/ssh_config
。
Ciphers arcfour
これでサーバーに接続できるようになりましたしかし、まだいくつか問題がある: 次のようなコマンドを実行するとコンソールがフリーズしますvim
。htop
アップデート: これに対する解決策を見つけましたが、それがどのように機能するかはわかりません。
設定するだけです最大伝送ユニットイーサネットまたはワイヤレス インターフェイスを非常に小さなものに接続します。
sudo ifconfig wlan0 mtu 1100 # (or eth0 for ethernet)