I have a very strange ssh issue, and I do not know how to solve it.
I am using Putty release 0.70, and the latest OpenSSH server from CentOS 7.4 (debug1: sshd version OpenSSH_7.4, OpenSSL 1.0.2k-fips 26 Jan 2017)
I have two centos hosts: first one is a physical server called server1, that acts as a host for the second one, called centos1. The centos1 is a virtual machine (VM) running in server1. A linux bridge in forwarding mode is used to connect the centos1 VM network interface to the server1 network interface and to the external network. The centos1 VM and the linux bridge are managed with libvirt.
Both server1 and centos1 have IP addresses in the same subnet, and both are reachable with ping from every other host in my network. In both server1 and centos1, the openssh-server configuration in /etc/ssh/sshd_config is the default one, and has not been changed.
When I ssh with Putty to the physical server server1 IP address, everything works as expected: I get a login prompt, I enter my password and I log in.
However, when I use Putty to connect to the centos1 VM, I do not get a login prompt whatsoever. I used openssh-server in debug mode, so see where the ssh connection hangs, and here is what I get:
[root@centos1 ~]# /sbin/sshd -p 22 -D -d -e
debug1: sshd version OpenSSH_7.4, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: private host key #0: ssh-rsa SHA256:pEuFQsodwK+0PoRzbVRba1ahHLEpwp8DG2KGQmxOGJk
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:F6HrSNWZhYaU7LMweI+RBviqTCHcTYyMBGPDz5OjT4c
debug1: private host key #2: ssh-ed25519 SHA256:aG3V6jjPHXUnNeavbxT/xozqrb5q3yWDkkAmXBCdnGk
debug1: rexec_argv[0]='/sbin/sshd'
debug1: rexec_argv[1]='-p'
debug1: rexec_argv[2]='22'
debug1: rexec_argv[3]='-D'
debug1: rexec_argv[4]='-d'
debug1: rexec_argv[5]='-e'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
Here the debug log stops and the openssh server waits for an inbound ssh client connection. At this stage I am using Putty with all default settings to connect to this openssh sever, that runs in the centos1 VM, and below is the debug log after Putty starts the ssh connection:
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
debug1: sshd version OpenSSH_7.4, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: private host key #0: ssh-rsa SHA256:pEuFQsodwK+0PoRzbVRba1ahHLEpwp8DG2KGQmxOGJk
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:F6HrSNWZhYaU7LMweI+RBviqTCHcTYyMBGPDz5OjT4c
debug1: private host key #2: ssh-ed25519 SHA256:aG3V6jjPHXUnNeavbxT/xozqrb5q3yWDkkAmXBCdnGk
debug1: inetd sockets after dupping: 3, 3
Connection from x.x.x.181 port 49436 on x.x.x.115 port 22
debug1: Client protocol version 2.0; client software version PuTTY_Release_0.70
debug1: no match: PuTTY_Release_0.70
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Enabling compatibility mode for protocol 2.0
debug1: SELinux support enabled [preauth]
debug1: permanently_set_uid: 74/74 [preauth]
debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
Here the debug mode stops, and there is no login prompt shown on the Putty windows. Actually nothing happens on the Putty window, even if I wait for couple of minutes. Finally when I give up and I close the Putty window, this is what is shown in the openssh server debug log:
Connection closed by x.x.x.181 port 49436 [preauth]
debug1: do_cleanup [preauth]
debug1: monitor_read_log: child log fd closed
debug1: do_cleanup
debug1: Killing privsep child 1274
So I do not understand why this is not working. I used the log in Putty side to see whats happening, and this is all what I get:
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2018.01.22 18:51:38 =~=~=~=~=~=~=~=~=~=~=~=
Event Log: Writing new session log (SSH packets mode) to file: C:\Users\adrian\Desktop\putty.log
Event Log: Connecting to x.x.x.115 port 22
Event Log: We claim version: SSH-2.0-PuTTY_Release_0.70
Now, I have tried with other ssh clients, like the openssh client that comes in centos (this is from another physical server, lets call it server2), and it works without any issue. I have checked the exactly same debug log, and here is what I get:
[...]
debug1: SELinux support enabled [preauth]
debug1: permanently_set_uid: 74/74 [preauth]
debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
Here it hangs with Putty, but with the openssh client it works, and the debug log continues like below:
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: algorithm: curve25519-sha256 [preauth]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
debug1: kex: client->server cipher:
chacha20...@openssh.com MAC: <implicit> compression: none [preauth]
debug1: kex: server->client cipher:
chacha20...@openssh.com MAC: <implicit> compression: none [preauth]
debug1: kex: curve25519-sha256 need=64 dh_need=64 [preauth]
debug1: kex: curve25519-sha256 need=64 dh_need=64 [preauth]
[...]
So, I would suspect is an issue with the Putty, however I have no clue how I can troubleshoot this further.
Any help is greatly appreciated.
Thanks,
Adrian