SSH connection refused even if firewall is disabled

0

In my office network, one of my clients (CentOS 7.5) couldn't connect to a remote server. The remote server is running CentOS 5.11, and has iptables and csf installed.

However, my client couldn't connect to it even if I disabled both iptables and csf on the remote host:

# ssh  -vvv x.x.x.x -p 2200
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug2: resolving "x.x.x.x" port 2200
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to x.x.x.x [x.x.x.x] port 2200.
debug1: connect to address x.x.x.xport 2200: Connection refused
ssh: connect to host x.x.x.x port 2200: Connection refused

~/.ssh/config on the client:

AddressFamily inet

/etc/ssh/ssh_config on the client:

ForwardX11Trusted yes
SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
SendEnv LC_IDENTIFICATION LC_ALL LANGUAGE
SendEnv XMODIFIERS
AddressFamily inet

sshd debug is empty on the server-side and no firewall/auth blocked message on logs.

On a Ubuntu 20.04 PC in the same network, I could connect to this server without any issues. (Running OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f 31 Mar 2020).

UPDATE

SELinux is disabled on the remote server.

The ssh log on the Ubuntu 20.04 PC:

OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /home/neil/.ssh/config
debug1: /home/neil/.ssh/config line 6: Applying options for *
debug3: kex names ok: [diffie-hellman-group-exchange-sha1]
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname x.x.x.x is address
debug1: auto-mux: Trying existing master
debug1: Control socket "/home/neil/.ssh/controlmasters/root@x.x.x.x-2200" does not exist
debug2: ssh_connect_direct
debug1: Connecting to x.x.x.x [x.x.x.x] port 2200.
debug1: Connection established.
debug1: identity file /home/neil/.ssh/id_rsa type 0
debug1: identity file /home/neil/.ssh/id_rsa-cert type -1
debug1: identity file /home/neil/.ssh/id_dsa type -1
debug1: identity file /home/neil/.ssh/id_dsa-cert type -1
debug1: identity file /home/neil/.ssh/id_ecdsa type -1
debug1: identity file /home/neil/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/neil/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/neil/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/neil/.ssh/id_ed25519 type -1
debug1: identity file /home/neil/.ssh/id_ed25519-cert type -1
debug1: identity file /home/neil/.ssh/id_ed25519_sk type -1
debug1: identity file /home/neil/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/neil/.ssh/id_xmss type -1
debug1: identity file /home/neil/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1
debug1: Remote protocol version 1.99, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH_2*,OpenSSH_3*,OpenSSH_4* compat 0x00000002
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to x.x.x.x:2200 as 'root'
debug3: put_host_port: [x.x.x.x]:2200
debug3: hostkeys_foreach: reading file "/home/neil/.ssh/known_hosts"
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group1-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-rsa,ssh-dss
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: MACs ctos: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: MACs stoc: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: diffie-hellman-group1-sha1
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug2: bits set: 498/1024
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ssh-rsa SHA256:aWGCYluAvO4zVxzSg8aebVzxWFhqS8gXqB9HwHO18ss
debug3: put_host_port: [x.x.x.x]:2200
debug3: put_host_port: [x.x.x.x]:2200
debug3: hostkeys_foreach: reading file "/home/neil/.ssh/known_hosts"
debug3: hostkeys_foreach: reading file "/home/neil/.ssh/known_hosts"
debug1: checking without port identifier
debug3: hostkeys_foreach: reading file "/home/neil/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/neil/.ssh/known_hosts:51
debug3: load_hostkeys: loaded 1 keys from x.x.x.x
debug1: Host 'x.x.x.x' is known and matches the RSA host key.
debug1: Found key in /home/neil/.ssh/known_hosts:51
debug1: found matching key w/out port
debug2: bits set: 495/1024
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey in after 4294967296 blocks
debug1: Will attempt key: /home/neil/.ssh/id_rsa RSA SHA256:aNIfT0BtU3emp9xhmG6yVDWcQl8WqBq4FBUeAeuZNdw agent
debug1: Will attempt key: /home/neil/.ssh/id_dsa 
debug1: Will attempt key: /home/neil/.ssh/id_ecdsa 
debug1: Will attempt key: /home/neil/.ssh/id_ecdsa_sk 
debug1: Will attempt key: /home/neil/.ssh/id_ed25519 
debug1: Will attempt key: /home/neil/.ssh/id_ed25519_sk 
debug1: Will attempt key: /home/neil/.ssh/id_xmss 
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-with-mic
debug3: start over, passed a different list publickey,gssapi-with-mic
debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)


debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)


debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/neil/.ssh/id_rsa RSA SHA256:aNIfT0BtU3emp9xhmG6yVDWcQl8WqBq4FBUeAeuZNdw agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: /home/neil/.ssh/id_rsa RSA SHA256:aNIfT0BtU3emp9xhmG6yVDWcQl8WqBq4FBUeAeuZNdw agent
debug3: sign_and_send_pubkey: RSA SHA256:aNIfT0BtU3emp9xhmG6yVDWcQl8WqBq4FBUeAeuZNdw
debug3: sign_and_send_pubkey: signing using ssh-rsa SHA256:aNIfT0BtU3emp9xhmG6yVDWcQl8WqBq4FBUeAeuZNdw
debug3: send packet: type 50
debug3: receive packet: type 52
debug1: Authentication succeeded (publickey).
Authenticated to x.x.x.x ([x.x.x.x]:2200).
debug1: setting up multiplex master socket
debug3: muxserver_listen: temporary control path /home/neil/.ssh/controlmasters/root@x.x.x.x-2200.jRkUUFdc5ICXvMqN
debug2: fd 4 setting O_NONBLOCK
debug3: fd 4 is O_NONBLOCK
debug3: fd 4 is O_NONBLOCK
debug1: channel 0: new [/home/neil/.ssh/controlmasters/root@x.x.x.x-2200]
debug3: muxserver_listen: mux listener channel 0 fd 4
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x08
debug1: control_persist_detach: backgrounding master process
debug2: control_persist_detach: background process is 177393
debug2: fd 4 setting O_NONBLOCK
debug1: forking to background
debug1: Entering interactive session.
debug1: pledge: id
debug2: set_control_persist_exit_time: schedule exit in 300 seconds
debug1: multiplexing control connection
debug2: fd 5 setting O_NONBLOCK
debug3: fd 5 is O_NONBLOCK
debug1: channel 1: new [mux-control]
debug3: channel_post_mux_listener: new mux channel 1 fd 5
debug3: mux_master_read_cb: channel 1: hello sent
debug2: set_control_persist_exit_time: cancel scheduled exit
debug3: mux_master_read_cb: channel 1 packet type 0x00000001 len 4
debug2: mux_master_process_hello: channel 1 slave version 4
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_master_read_cb: channel 1 packet type 0x10000004 len 4
debug2: mux_master_process_alive_check: channel 1: alive check
debug3: mux_client_request_alive: done pid = 177395
debug3: mux_master_read_cb: channel 1 packet type 0x10000002 len 70
debug3: mux_client_request_session: session request sent
debug2: mux_master_process_new_session: channel 1: request tty 1, X 0, agent 0, subsys 0, term "xterm-256color", cmd "", env 1
debug3: mux_master_process_new_session: got fds stdin 6, stdout 7, stderr 8
debug1: channel 2: new [client-session]
debug2: mux_master_process_new_session: channel_new: 2 linked to control channel 1
debug2: channel 2: send open
debug3: send packet: type 90
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 2: callback start
debug2: client_session2_setup: id 2
debug2: channel 2: request pty-req confirm 1
debug3: send packet: type 98
debug1: Sending environment.
debug1: Sending env LANG = en_NZ.UTF-8
debug2: channel 2: request env confirm 0
debug3: send packet: type 98
debug2: channel 2: request shell confirm 1
debug3: send packet: type 98
debug3: mux_session_confirm: sending success reply
debug2: channel_input_open_confirmation: channel 2: callback done
debug2: channel 2: open confirm rwindow 0 rmax 32768
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 2
debug2: PTY allocation request accepted on channel 2
debug2: channel 2: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 2
debug2: shell request accepted on channel 2
Last login: Tue Aug 11 09:33:30 2020 from XXXX
[root@remote_server ~] #
ssh
asked on Server Fault Aug 10, 2020 by NeilWang • edited Aug 10, 2020 by NeilWang

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0