我曾经使用这个命令连接到使用OpenSSH连接到我的服务器:
ssh [email protected]
但现在我改变了我的位置,我不能再连接了,这里是我使用ssh命令使用-v参数时的debugging报告:
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上
EDIT1: /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
它会提示我input密码,但是控制台之后就会冻结:
[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
在/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”模式中,连接将被拒绝。
我刚刚在/etc/ssh/ssh_config添加了一行,指向许多论坛。
Ciphers arcfour
现在,我可以连接到服务器, 但仍然存在一些问题 :当我运行像vim , htop类的somme命令时,控制台会冻结
更新 :我已经find了这个解决scheme,但不知道如何工作。
只需将您的以太网或无线接口上的MTU设置为非常小的值即可。
sudo ifconfig wlan0 mtu 1100 # (or eth0 for ethernet)