
저는 다음 명령을 사용하여 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는 작동하지 않습니다. 나는 우분투에 있어요
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
EDIT2: 이 명령줄을 사용하여 암호를 변경하려고 할 때:
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 파일에서 루트 사용자의 소스 연결에 제한이 있을 가능성이 높습니다.
구체적으로 authorized_keys
다음과 같을 것입니다.
from="trusted.host.some.domain.ext,10.0.0.*,:*.untrusted.network.ext" ssh-rsa [your key] root@localhost
연결이 "from" 패턴과 일치하지 않는 경우(해당 패턴에서 명시적으로 제외된 경우) 연결이 거부됩니다.
답변2
/etc/ssh/ssh_config
방금 여러 포럼을 참조하면서 한 줄을 추가했습니다 .
Ciphers arcfour
이제 서버에 연결할 수 있습니다.하지만 여전히 몇 가지 문제가 있습니다: 다음과 같은 일부 명령을 실행하면 콘솔이 정지됩니다 vim
.htop
업데이트: 이에 대한 해결책을 찾았지만 이것이 어떻게 작동하는지 모르겠습니다.
그냥 설정하세요MTU이더넷이나 무선 인터페이스에서 아주 작은 것에 이르기까지.
sudo ifconfig wlan0 mtu 1100 # (or eth0 for ethernet)