У меня есть два сервера Centos 7.2. IP-адрес одной машины - 10.104.196.18, другой машины - 10.240.197.21. Я могу успешно SSH с 10.104.196.18 по 10.240.197.21. Но не удалось ssh в 10.104.196.18 от 10.240.197.21.
Журнал ssh выглядит так:
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 56: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to 10.104.196.18 [10.104.196.18] port 6990. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug3: Incorrect RSA1 identifier debug3: Could not load "/root/.ssh/id_rsa" as a RSA1 public key 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: identity file /root/.ssh/id_ed25519 type -1 debug1: identity file /root/.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
Журнал sshd выглядит так:
[root@localhost ~]# /usr/sbin/sshd -dD -p 10000 debug1: sshd version OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013 debug1: key_parse_private2: missing begin marker debug1: read PEM private key done: type RSA debug1: private host key: #0 type 1 RSA debug1: key_parse_private2: missing begin marker debug1: read PEM private key done: type ECDSA debug1: private host key: #1 type 3 ECDSA debug1: private host key: #2 type 4 ED25519 debug1: rexec_argv[0]='/usr/sbin/sshd' debug1: rexec_argv[1]='-dD' debug1: rexec_argv[2]='-p' debug1: rexec_argv[3]='10000' Set /proc/self/oom_score_adj from 0 to -1000 debug1: Bind to port 10000 on 0.0.0.0. Server listening on 0.0.0.0 port 10000. debug1: Bind to port 10000 on ::. Server listening on :: port 10000. debug1: Server will not fork when running in debugging mode. debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8 debug1: inetd sockets after dupping: 3, 3 Connection from 10.96.203.72 port 49845 on 10.240.197.21 port 10000
Так что, очевидно, и клиент, и сервер ожидают обмена удостоверениями. А из tcpdump мы подтверждены анализом пакетов.
[root@localhost examples]# ~/disable_firewall.sh [root@localhost examples]# iptables-save # Generated by iptables-save v1.4.21 on Sat Oct 14 13:08:28 2017 *security :INPUT ACCEPT [220:24998] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [109:12506] COMMIT # Completed on Sat Oct 14 13:08:28 2017 # Generated by iptables-save v1.4.21 on Sat Oct 14 13:08:28 2017 *raw :PREROUTING ACCEPT [692:70796] :OUTPUT ACCEPT [109:12506] COMMIT # Completed on Sat Oct 14 13:08:28 2017 # Generated by iptables-save v1.4.21 on Sat Oct 14 13:08:28 2017 *mangle :PREROUTING ACCEPT [692:70796] :INPUT ACCEPT [220:24998] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [109:12506] :POSTROUTING ACCEPT [109:12506] COMMIT # Completed on Sat Oct 14 13:08:28 2017 # Generated by iptables-save v1.4.21 on Sat Oct 14 13:08:28 2017 *nat :PREROUTING ACCEPT [395:43515] :INPUT ACCEPT [32:7088] :OUTPUT ACCEPT [17:1020] :POSTROUTING ACCEPT [17:1020] COMMIT # Completed on Sat Oct 14 13:08:28 2017 # Generated by iptables-save v1.4.21 on Sat Oct 14 13:08:28 2017 *filter :INPUT ACCEPT [220:24998] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [109:12506] COMMIT
И обе стороны могут успешно пинговать друг друга. Так я запутался, как пакеты теряются только однонаправленно?
@KamilMaciorowski Спасибо за ваш отзыв, я изменил это.
Jackson Zheng 6 лет назад
0
1 ответ на вопрос
0
Gohu
Глядя на ваши снимки, 3-стороннее рукопожатие по протоколу TCP хорошо выполнено. Пакет, отправленный сервером после трехстороннего рукопожатия, содержит объявление строки версии, в вашем случае:
SSH-2,0-OpenSSH_6.6.1
Этот пакет никогда не достигает клиента. Это может указывать на наличие брандмауэра приложения, который молча отбрасывал сеанс TCP после классификации его как SSH (также обратите внимание, что брандмауэр приложения может работать однонаправленно)
Разве брандмауэр не блокировал все пакеты вместе?
Jackson Zheng 6 лет назад
0
Брандмауэры приложений работают на уровне приложений и должны видеть полезную нагрузку TCP (после трехэтапного TCP-квитирования), чтобы принять решение об удалении / блокировке. Есть ли у вас такой межсетевой экран между вашими 2 конечными точками SSH?
Gohu 6 лет назад
0