RHEL7을 새로 설치한 후 SSH는 어디서나 시간 초과됩니다.

RHEL7을 새로 설치한 후 SSH는 어디서나 시간 초과됩니다.
[user@desktop ~]$ ssh root@foobar
...
$ sudo su -
[YOU HAVE NEW MAIL]
root@foobar:/home/root # cd /etc 
root@foobar:/etc # Connection to 1.2.3.4 closed by remote host.
Connection to 1.2.3.4 closed.
[user@desktop ~]$ 

내 데스크탑에 RHEL7을 설치한 후(이전에는 RHEL6이었고 완벽하게 작동했습니다).

질문:ssh 어디에 있든 항상 원격 호스트에 의해 연결이 닫혔다는 메시지가 표시됩니다. 로그인 후 몇 초.. 왜? 새로 설치하기 전에는 잘 작동했습니다.

업데이트: "1) "telnet yourhost 22"를 실행하면 어떻게 되나요? -> 그렇게 했는데 telnet이 연결을 끊지 않았습니다!

업데이트 #2:

[USER@DESKTOP applications]$ ssh -vvv USERONSERVER@SERVERNAME
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /home/USER/.ssh/config
debug1: /home/USER/.ssh/config line 1: Applying options for dee1*
debug1: /home/USER/.ssh/config line 7: Applying options for dee1*
debug1: /home/USER/.ssh/config line 18: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: /etc/ssh/ssh_config line 67: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to SERVERNAME [1.2.3.4] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/USER/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/USER/.ssh/id_rsa type 1
debug1: identity file /home/USER/.ssh/id_rsa-cert type -1
debug1: identity file /home/USER/.ssh/id_dsa type -1
debug1: identity file /home/USER/.ssh/id_dsa-cert type -1
debug1: identity file /home/USER/.ssh/id_ecdsa type -1
debug1: identity file /home/USER/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/USER/.ssh/id_ed25519 type -1
debug1: identity file /home/USER/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 1.99, remote software version OpenSSH_6.0
debug1: match: OpenSSH_6.0 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "SERVERNAME" from file "/home/USER/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/USER/.ssh/known_hosts:822
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],ssh-rsa,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: setup hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: setup hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: kex: ecdh-sha2-nistp256 need=16 dh_need=16
debug1: kex: ecdh-sha2-nistp256 need=16 dh_need=16
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA censored
debug3: load_hostkeys: loading entries for host "SERVERNAME" from file "/home/USER/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/USER/.ssh/known_hosts:822
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "1.2.3.4" from file "/home/USER/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/USER/.ssh/known_hosts:801
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'SERVERNAME' is known and matches the RSA host key.
debug1: Found key in /home/USER/.ssh/known_hosts:822
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/USER/.ssh/id_rsa (0x7fe5faa58140),
debug2: key: Created by SASGUI (0x7fe5faa589f0),
debug2: key: id_rsa (0x7fe5faa59040),
debug2: key: /home/USER/.ssh/id_dsa ((nil)),
debug2: key: /home/USER/.ssh/id_ecdsa ((nil)),
debug2: key: /home/USER/.ssh/id_ed25519 ((nil)),
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/USER/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 148
debug2: input_userauth_pk_ok: fp censored
debug3: sign_and_send_pubkey: RSA censored
debug1: Authentication succeeded (publickey).
Authenticated to SERVERNAME ([1.2.3.4]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Remote: Forced command.
debug1: Remote: Forced command.
debug2: callback start
debug1: Requesting authentication agent forwarding.
debug2: channel 0: request [email protected] confirm 0
debug2: fd 3 setting TCP_NODELAY
debug3: packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug3: Ignored env XDG_VTNR
debug3: Ignored env SSH_AGENT_PID
debug3: Ignored env XDG_SESSION_ID
debug3: Ignored env GUESTFISH_INIT
debug3: Ignored env HOSTNAME
debug3: Ignored env IMSETTINGS_INTEGRATE_DESKTOP
debug3: Ignored env GPG_AGENT_INFO
debug3: Ignored env VTE_VERSION
debug3: Ignored env TERM
debug3: Ignored env SHELL
debug3: Ignored env XDG_MENU_PREFIX
debug3: Ignored env HISTSIZE
debug3: Ignored env GJS_DEBUG_OUTPUT
debug3: Ignored env WINDOWID
debug3: Ignored env QTDIR
debug3: Ignored env QTINC
debug3: Ignored env GJS_DEBUG_TOPICS
debug3: Ignored env IMSETTINGS_MODULE
debug3: Ignored env QT_GRAPHICSSYSTEM_CHECKED
debug3: Ignored env USER
debug3: Ignored env LS_COLORS
debug3: Ignored env SSH_AUTH_SOCK
debug3: Ignored env SESSION_MANAGER
debug3: Ignored env USERNAME
debug3: Ignored env GNOME_DISABLE_CRASH_DIALOG
debug3: Ignored env GUESTFISH_PS1
debug3: Ignored env PATH
debug3: Ignored env MAIL
debug3: Ignored env DESKTOP_SESSION
debug3: Ignored env QT_IM_MODULE
debug3: Ignored env PWD
debug1: Sending env XMODIFIERS = @im=ibus
debug2: channel 0: request env confirm 0
debug1: Sending env LANG = en_US.utf8
debug2: channel 0: request env confirm 0
debug3: Ignored env GDM_LANG
debug3: Ignored env KDEDIRS
debug3: Ignored env GUESTFISH_OUTPUT
debug3: Ignored env PD_SOCKET
debug3: Ignored env GDMSESSION
debug3: Ignored env HISTCONTROL
debug3: Ignored env XDG_SEAT
debug3: Ignored env HOME
debug3: Ignored env SHLVL
debug3: Ignored env GNOME_DESKTOP_SESSION_ID
debug3: Ignored env XDG_SESSION_DESKTOP
debug3: Ignored env LOGNAME
debug3: Ignored env QTLIB
debug3: Ignored env DBUS_SESSION_BUS_ADDRESS
debug3: Ignored env LESSOPEN
debug3: Ignored env WINDOWPATH
debug3: Ignored env PDHOST
debug3: Ignored env XDG_RUNTIME_DIR
debug3: Ignored env DISPLAY
debug3: Ignored env QT_PLUGIN_PATH
debug3: Ignored env XDG_CURRENT_DESKTOP
debug3: Ignored env GUESTFISH_RESTORE
debug3: Ignored env XAUTHORITY
debug3: Ignored env OLDPWD
debug3: Ignored env _
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0

censored - motd here - censored

$ sudo su -
[YOU HAVE NEW MAIL]
root@SERVERNAME:/home/root # date
Fri Apr 15 10:39:22 UTC 2016
root@SERVERNAME:/home/root # debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i0/0 o0/0 fd 4/5 cc -1)

Connection to SERVERNAME closed by remote host.
Connection to SERVERNAME closed.
Transferred: sent 4240, received 4440 bytes, in 217.5 seconds
Bytes per second: sent 19.5, received 20.4
debug1: Exit status -1
[USER@DESKTOP applications]$ 

답변1

문제 해결을 수행하십시오.

1) "telnet yourhost 22"를 실행하면 어떻게 됩니까?

다음과 같은 일이 발생합니다(물론 올바른 IP가 필요함).

 Trying 1.2.3.4...
 Connected to yourhost (1.2.3.4)
 Escape character is '^]'.
 Connection closed by foreign host.

2) "종료"는 얼마나 빨리 발생합니까?

4/5초라고 말하고 싶어요

3) "ssh -v yourhost"의 출력은 무엇입니까?

또한 sshd 구성 파일( )에서 keepalive 설정을 확인하십시오 /etc/ssh/sshd_config. 설정, TCPKeepAlive=yes

아니면 사용해 보세요ssh -o TCPKeepAlive=yes

답변2

하드웨어는 T450입니다. Wi-Fi로 인한 문제인 것으로 나타났습니다. 이더넷 케이블에서는 잘 작동합니다.

echo 'options iwlmvm power_scheme=1' >> /etc/modprobe.d/iwlmvm.conf
cd /boot
cp initramfs-3.10.0-327.4.5.el7.x86_64.img initramfs-3.10.0-327.4.5.el7.x86_64.img.orig
dracut -v -f  initramfs-3.10.0-327.4.5.el7.x86_64.img  3.10.0-327.4.5.el7.x86_64
rebooot

관련 정보