Cannot open new SSH connections after a certain amount of time - networking

I have a web server running Alpine linux and OpenSSH. When I power on the server, for about an hour or two I am able to open SSH connections and send commands fine. However, after that, even though the server is up, it does not respond to pings and I cannot SSH in to it. The server is still running, and I can still access the website being served from it. Why does this happen, and how can I avoid it?

Related

Connectivity issue between two Windows systems on the same network

I am trying to set up a license server for a CAE software.
Server side everything is working fine, logs are clean and the application successfully reaches the licensing server locally.
I have fixed by configuration the listening ports and opened them on the firewall, so I moved to the next step which was setting up the clients.
The first one worked fine and successfully connects to the licensing server, while the second returned error.
I tried to run a Test-NetConnection to those ports with Powershell from both machines and as expected it worked for the first one while it didn't for the second. Ping succeeds but TCP connection fails.
What could be the issue?
Thanks everyone for your time and support.

We are having issues with accessing our websites on multiple Wifi's, but 4g works always. Wordpress hosted on digital ocean

Both us, and our clients are having issues, while trying to access the development servers on digital ocean. Most of the time it works fine, but sometimes we get errors and are unable to access the website. However, then we switch over to 4g network, and can access the website without a hassle.
Could this be some kind of a automatic IP blocking on Digital ocean's side?
Here is an example of an website on our server
https://nyjasaf.bigsheepstudios.com
********* New Information *********
Ran this command on the server iptables -L INPUT -v -n
Got this info:
Screen shot of the terminal
But would it make sense that it would be IP blocking, since it only happens sometimes?

Whats the difference between ConnectTimeout and ServerAliveInterval in ssh

I am doing ssh on several remote servers, Some of the servers doesn't respond and some of them might be down.
To preclude such scenarios I used ConnectTimeout in ssh command. It was timing out as I configured It to be.
My current way of doing ssh
ssh -o LogLevel=Error -oConnectTimeout=5 -oBatchMode=yes -l becomeaccount servername './command.sh'
All was going good until one day when I found a stale ssh connection on one of my server. It was on for more than 3 days.
So now I think I might have missed something, I tried to google it and found there is something called as ServerAliveInterval...would that solve my problem? how is it different than ConnectTimeOut ?
The "ServerAliveInterval" specifies a periodic polling time between the SSH server and client. The intent is twofold:
(1) To close down idle ssh sessions where either
[a] one side or the other crashes hard (i.e.: machine failure/poweroff)
[b] one side or the other changes IP addresses
(2) To MAINTAIN idle ssh sessions over a NAT that would tear down (or terminate) idle TCP sessions
ServerAliveInterval affects the "ssh" client. There's a corresponding parameter for the "sshd" server. (There is also a TCPKeepAlive option too.) If you're seeing orphaned sshd sessions on your remote servers, you should consider making appropriate changes in the remote servers's sshd_config. If you can't implement changes in the remote server's sshd_config but still need to have idle logins die, check to see if your shell has an idle-timeout ("bash" does.)

Can't connect to local server

Currently we have a system in place where multiple server backup to a server in house. There are a total of 11 different servers backing up to this one storage server. Without any change(any that we are aware of) one of the servers stopped being able to connect to the storage server. It's weird too because the one that can't connect is actually our DNS server. It can ping the storage server and nslookup returns the appropriate value. However when I tried to browse to the server in windows explore via network I get the following message:
"Check the spelling of the name. Otherwise, there might be a problem with your network. To try to identify and resolve network problems, click Diagnose." - Error Code: 0x800004005 Unspecified error.
If at all possible I would like the solution to not have to restart the server(obviously that's a big request) but we run 24/7 and can't have the DNS server down for the next few weeks.
Thanks in advance!
I am completely guessing here however lets start with this, does it work if you try and connect to the share using IP?
A few things to consider in the mean time? What O.S is it?
-> Is network discovery off?
-> Have any firewalls been accidentally turned on
-> We had a similar sort of problem when the server lost it's trust relationship with AD (required a reboot I am afraid).
Unfortunately this error can relate to a range of problems including network devices, anti-virus, firewalls, shares, user accounts etc etc.

The server rejected SFTP connection, but it listens for FTP connections

When I use WinSCP in Windows to connect to VMware with Ubuntu, it prompted this:
The server rejected SFTP connection, but it listens for FTP connections.
Did you want to use FTP protocol instead of SFTP? Prefer using encryption.
What's the matter?
I can succeed to ping Ubuntu in Windows.
The fact that you can ping the server has nothing to do with what protocols it supports.
The message says that the server does not listen on port 22 (SSH, SFTP), but listens on port 21 (FTP). The point of the message is that WinSCP defaults to SFTP protocol, what is not common. So it tries to help users who expect FTP to be a default. But that's not relevant to you apparently.
As #ps2goat suggested, make sure you setup SSH/SFTP server.
For more details, see the documentation for the error message The server rejected SFTP connection, but it listens for FTP connections.
If you see this error all of a sudden (when SFTP has always worked for you for this particular server), and if you are using CSF (ConfigServer Security & Firewall), then it might be that your IP was blocked for SSH access. Try flushing all blocks. Also, try restarting the SSH server.
Old question but still responding so others might get benefited.
I stumbled upon this error and the first thing I checked was if my ubuntu machine had ssh installed. It was there and the latest version and I still would get this error.
As long as you have ssh access to the target, check the ssh service status and most certainly it'd be found inactive. Turn it on using
sudo service ssh restart
and you should be back in the game.
Do check the status of the SFTP by using
sudo service ssh status
and take any corrective action.

Resources