Добрый день Уесть система мониторинга KS Host, оттуда запускается проверка типа SSH Test, на сервере лежит скрипт, который в верном формате возвращает данные. Возникла проблема, что при выполнении данной проверке на серверах с ОС CentOS 6 - все выполняется корректно. При выполнении проверки на серверах с CentOS 7 - судя по логам, ssh дисконнект происходит ещё до выполнения скрипта. Настройки sshd_config сверил, вроде все верно, не подскажете, что это может быть. Вот лог ssh сессии с сервера CentOS6 , где все работает:
debug1: Forked child 29293.
Set /proc/self/oom_score_adj to 0
debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8
debug1: inetd sockets after dupping: 3, 3
Connection from XXX.XXX.XXX.XXX port 4413
debug1: Client protocol version 2.0; client software version KS_SSH
debug1: no match: KS_SSH
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: permanently_set_uid: 74/74
debug1: list_hostkey_types: ssh-rsa,ssh-dss
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: client->server aes128-cbc hmac-sha1 none
debug1: kex: server->client aes128-cbc hmac-sha1 none
debug1: expecting SSH2_MSG_KEXDH_INIT
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: KEX done
debug1: userauth-request for user MONITORING service ssh-connection method none
debug1: attempt 0 failures 0
debug1: PAM: initializing for "MONITORING"
debug1: PAM: setting PAM_RHOST to "XXXXXXX"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: userauth-request for user MONITORING service ssh-connection method password
debug1: attempt 1 failures 0
debug1: PAM: password authentication accepted for MONITORING
debug1: do_pam_account: called
Accepted password for MONITORING from XXX.XXX.XXX.XXX port 4413 ssh2
debug1: monitor_child_preauth: MONITORING has been authenticated by privileged process
debug1: temporarily_use_uid: 501/501 (e=0/0)
debug1: ssh_gssapi_storecreds: Not a GSSAPI mechanism
debug1: restore_uid: 0/0
debug1: SELinux support disabled
debug1: PAM: establishing credentials
pam_unix(sshd:session): session opened for user MONITORING by (uid=0)
debug1: temporarily_use_uid: 501/501 (e=0/0)
debug1: ssh_gssapi_storecreds: Not a GSSAPI mechanism
debug1: restore_uid: 0/0
User child is on pid 29295
debug1: PAM: establishing credentials
debug1: permanently_set_uid: 501/501
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch_20
debug1: server_input_channel_open: ctype session rchan 0 win 16384 max 16384
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_channel_req: channel 0 request exec reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req exec
debug1: session_new: session 0
=======Тут результат выполнения скрипта=======
sudo: MONITORING : TTY=unknown ; PWD=/home/MONITORING ; USER=root ; COMMAND=/usr/sbin/asterisk -rx sip show registry
=================================================
debug1: Received SIGCHLD.
debug1: session_by_pid: pid 29296
debug1: session_exit_message: session 0 channel 0 pid 29296
debug1: session_exit_message: release channel 0
Received disconnect from XXX.XXX.XXX.XXX: 11: session close
debug1: do_cleanup
debug1: do_cleanup
debug1: PAM: cleanup
debug1: PAM: closing session
pam_unix(sshd:session): session closed for user MONITORING
debug1: PAM: deleting credentials
Вывод лога ssh с Centos 7, где идет сразу дисконнект
Forked child 30820.
Set /proc/self/oom_score_adj to 0
rexec start in 5 out 5 newsock 5 pipe 7 sock 8
inetd sockets after dupping: 3, 3
Connection from XXX.XXX.XXX.XXX port 3948 on XXX.XXX.XXX.XXX port 22
debug1: Client protocol version 2.0; client software version KS_SSH
debug1: no match: KS_SSH
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Enabling compatibility mode for protocol 2.0
debug1: SELinux support disabled [preauth]
debug1: permanently_set_uid: 74/74 [preauth]
debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: algorithm: diffie-hellman-group1-sha1 [preauth]
debug1: kex: host key algorithm: ssh-dss [preauth]
debug1: kex: client->server cipher: aes128-cbc MAC: hmac-sha1 compression: none [preauth]
debug1: kex: server->client cipher: aes128-cbc MAC: hmac-sha1 compression: none [preauth]
debug1: kex: diffie-hellman-group1-sha1 need=20 dh_need=20 [preauth]
debug1: kex: diffie-hellman-group1-sha1 need=20 dh_need=20 [preauth]
debug1: expecting SSH2_MSG_KEXDH_INIT [preauth]
debug1: rekey after 4294967296 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: rekey after 4294967296 blocks [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user MONITORING service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: PAM: initializing for "MONITORING"
debug1: PAM: setting PAM_RHOST to "XXXXXXXX"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: userauth-request for user MONITORING service ssh-connection method password [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: PAM: password authentication accepted for MONITORING
debug1: do_pam_account: called
Accepted password for MONITORING from XXX.XXX.XXX.XXX port 3948 ssh2
debug1: monitor_child_preauth: MONITORING has been authenticated by privileged process
debug1: monitor_read_log: child log fd closed
debug1: temporarily_use_uid: 1001/1001 (e=0/0)
debug1: ssh_gssapi_storecreds: Not a GSSAPI mechanism
debug1: restore_uid: 0/0
debug1: SELinux support disabled
debug1: PAM: establishing credentials
pam_unix(sshd:session): session opened for user MONITORING by (uid=0)
User child is on pid 30822
debug1: PAM: establishing credentials
debug1: permanently_set_uid: 1001/1001
debug1: rekey after 4294967296 blocks
debug1: rekey after 4294967296 blocks
debug1: ssh_packet_set_postauth: called
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch
debug1: server_input_channel_open: ctype session rchan 0 win 16384 max 16384
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
==========Сразу идет дисконнект без выполнения скрипта========
Received disconnect from XXX.XXX.XXX.XXX port 3948:11: end
Disconnected from XXX.XXX.XXX.XXX port 3948
debug1: do_cleanup
debug1: do_cleanup
debug1: PAM: cleanup
debug1: PAM: closing session
pam_unix(sshd:session): session closed for user MONITORING
debug1: PAM: deleting credentials
Подскажите, пожалуйста, что может давать такой эффект