was connected to a server via ssh through port 22, and decided to kill all the users connected with the root user with the following command:
pkill -9 -u root
Now when I try to log in by root@190.169.94.56, I get the message:
ssh: connect to host 190.169.94.56 port 22: Connection refused
I make sure that SSH is indeed running on the port 22. On the server machine, I run:
netstat -untap | grep 190.169.94.56
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 190.169.94.9:41267 190.169.94.56:22 ESTABLISHED 29673/ssh
I did ping the server 190.169.94.56 and responds correctly:
ping 190.169.94.56
PING 190.169.94.56 (190.169.94.56) 56(84) bytes of data.
64 bytes from 190.169.94.56: icmp_seq=1 ttl=64 time=0.524 ms
64 bytes from 190.169.94.56: icmp_seq=2 ttl=64 time=0.454 ms
64 bytes from 190.169.94.56: icmp_seq=3 ttl=64 time=0.423 ms
64 bytes from 190.169.94.56: icmp_seq=4 ttl=64 time=0.419 ms
--- 190.169.94.56 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.419/0.455/0.524/0.042 ms
I tried change the port and i obtain the same result. How can I connect to it again? It's a Debian machine, in case that matters.
sshd
isn't running; thenetstat
step that you think proves it is, doesn't. Restartsshd
. – MadHatter supports Monica Apr 10 '14 at 16:10pkill
, cause thesshd
normally launches with the root user. The connection shown on your netstat is related to the one that is open and running. The ports that are ready and Listening for new connections will look like this:tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 9626/sshd
. Restart/reload your ssh to get things back again. – user122772 Apr 10 '14 at 16:40