problem connecting to a host via shh which was working before but stopped working suddenly.
ssh -v root@xx.xxx.xx.xxx
OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f 31 Mar 2020
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 *
debug1: Connecting to xx.xxx.xx.xxx [xx.xxx.xx.xxx] port 22.
debug1: Connection established.
debug1: identity file /home/ash/.ssh/id_rsa type 0
debug1: identity file /home/ash/.ssh/id_rsa-cert type -1
debug1: identity file /home/ash/.ssh/id_dsa type -1
debug1: identity file /home/ash/.ssh/id_dsa-cert type -1
debug1: identity file /home/ash/.ssh/id_ecdsa type -1
debug1: identity file /home/ash/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/ash/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/ash/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/ash/.ssh/id_ed25519 type -1
debug1: identity file /home/ash/.ssh/id_ed25519-cert type -1
debug1: identity file /home/ash/.ssh/id_ed25519_sk type -1
debug1: identity file /home/ash/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/ash/.ssh/id_xmss type -1
debug1: identity file /home/dali/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
Stuck after this point and freezes.
I tried the below options but no luck.
ssh -o StrictHostKeyChecking=no -v user@xx.xx.xxx.xxx
ssh -o UseDNS=no -vvv user@xx.xx.xxx.xxx
I tried reinstalling openssh-server and updated ssh_config UseDNS=no and restarted sshd
I was able to connect to the same host from other users in the network with my key so seems the server is accepting my key but only not from my machine or sshd from machine.
it seems the connection is estabilished but nothing happens after that.
The destination host is a vm and other users are able to connect to it. And i tried connecting from other users machine in the same network with my credentials and it works.
I was able to telnet and ping the host.
Reference to What does it mean if SSH hangs after `Connection Established`?
i tried the below:
In general there are several things that could cause this:
- The client has connected to something that's not an SSH server. For
example, an HTTP server wouldn't send anything to the client,
because the HTTP protocol expects the client to send the first data.
- it is an ssh server.
- The server is malfunctioning. For example the server might be overloaded, and the SSH server process isn't getting a chance to run. - server was able to get connected from other nodes on the network this one is ruled out.
- The server is hung somehow. It might be stuck doing a DNS query on the client's IP address, for example. - i changed the dns no in ssh config which didnt help.
- Some network device is interfering with the TCP connection. - was able to telnet and ping.