Score:1

Operation time out when attempting to ssh to server

ca flag

I was transferring a file between two remote machines when the scp command stopped at 92%. When I went in to retry it, I realized that I could no longer ssh into the server. However, I do have access via my server host's VNC terminal.

I tried restarting sshd, doing a systemctl reboot, and shutting down/restarting the server from my host's web panel, but I'm still unable to SSH into the server. I've also checked /var/log/auth.log and it hasn't logged anything about the connection timeouts.

I disabled the server firewall completely (iptables) and the output of systemctl status sshd shows that it is working and listening on port 22.

Output of iptables -L:

Chain INPUT (policy ACCEPT)
Chain FORWARD (policy ACCEPT)
Chain OUTPUT (policy ACCEPT)

I have been able to ssh into other servers just fine from my machine. The output of my SSH command with -vvv is:

OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to <server-ip> port 22.
ssh: connect to host <server-ip> port 22: Operation timed out

In addition, as mentioned in some other related questions here, I manually started sshd on port 42 with /usr/sbin/sshd -p 42 -d and attempted to connect, but the connection still timed out from my local machine and no output was logged to the terminal.

As per a suggestion in the comments, I ran ssh user@localhost from within my VNC terminal, and that worked. So it appears that ssh is working for localhost, but no other users can connect from outside. Seems like a firewall issue, but I've opened up all my iptables rules.

Update: SSH randomly started working for about 30 minutes with no changes. I was able to copy the file over that I needed to. Then, shortly after, the connection froze and disconnected me, and it's back to not working again.

Score:0
ng flag

Looks like a network issue, Operation timed out usually means that ssh was not able establish connection. What type of hosting do you use?

Timothy Fisher avatar
ca flag
Yeah ... this turned out to be the issue. Talked to hosting provider live support and they told me that they locked down the IP address due to high network activity thinking it was a DDoS attack. I didn't have access to the email address associated with the account at the time so I didn't get the alert. They lifted the hold, and all is good now.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.