服務器A通過ssh -v root@ip地址B 時,提示以下報錯,
排查情形有1:服務器B能夠正常ssh到服務器A;2:hosts.allow已配置也重啟過sshd,但沒有效果;3:檢查sshd_config配置已無問題,4:服務器Aping或telnet服務器B都正常,請求各路大神賜教,拜謝。
OpenSSH_7.9p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to ip地址B [ip地址B] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/identity-cert type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.9
debug1: match: OpenSSH_7.9 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'ip地址B' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:42
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
Connection closed by ip地址B
uj5u.com熱心網友回復:
看下B的日志,具體是什么原因uj5u.com熱心網友回復:
服務器B上的日志messages輸出內容有一個報錯是:Aug 20 12:00:18 TS-NW-S07 smbd[2855]: [2019/08/20 12:00:18.199143, 0] printing/print_cups.c:528(cups_async_callback)
Aug 20 12:00:18 TS-NW-S07 smbd[2855]: failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
Aug 20 12:13:18 TS-NW-S07 smbd[88015]: [2019/08/20 12:13:18.885695, 0] printing/print_cups.c:151(cups_connect)
Aug 20 12:13:18 TS-NW-S07 smbd[88015]: Unable to connect to CUPS server localhost:631 - Connection refused
smb.conf配置如下,是跟這個有關系
load printers = yes
cups options = raw
; printcap name = /etc/printcap
#obtain list of printers automatically on SystemV
; printcap name = lpstat
; printing = cups
uj5u.com熱心網友回復:
應該不是,你看看secure日志
uj5u.com熱心網友回復:
secure日志里并沒有關于服務器A的日志資訊,不過有其他服務器地址的日志資訊如下:Aug 20 12:47:27 TS-NW-S07 sshd[90020]: pam_unix(sshd:account): password for user weblogic will expire in 14 days
Aug 20 12:47:27 TS-NW-S07 sshd[90020]: Accepted password for weblogic from 服務器C port 52738 ssh2
Aug 20 12:47:27 TS-NW-S07 sshd[90020]: pam_unix(sshd:session): session opened for user weblogic by (uid=0)
Aug 20 12:47:37 TS-NW-S07 su: pam_unix(su-l:session): session opened for user root by weblogic(uid=502)
uj5u.com熱心網友回復:
看你上面的日志,好像是使用密鑰登錄時,被拒絕了。應該secure會有日志。你看下B的/root/.ssh/authorized_keys里面有沒有A的記錄,有的話 可以考慮刪掉,然后重新傳一次公鑰;或者使用密碼登錄
uj5u.com熱心網友回復:
另外,B是不是禁用了密碼登錄啊,不然密鑰不成功,應該也可以賬號登錄啊uj5u.com熱心網友回復:
B這個應該沒有禁用密碼的,跟服務器A同一網段的其他服務器是能夠正常ssh到B的;authorized_keys檔案洗掉重建互信過也不行,另外我是把ssh命令執行與查看secure日志同步進行的,B上的確是沒有日志進來,很奇怪
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/101873.html
標籤:專題技術討論區
上一篇:linux 里如何重繪 mounted sd card file directory ?
下一篇:ubuntu自動回到登錄界面
