Web Hosting & VPS Tips

Unleash Your Server Potential with Expert Insights

Hosting provided by: Cloudways
Free to Try! Up to 40% Off!

Category: VPS Setup

Adjust SSH timeoutsession idle duration—on a CentOS VPS to prevent hangups—edit /etc/ssh/sshd_config with
nano /etc/ssh/sshd_config
adding ClientAliveInterval 300 (5 minutes) and ClientAliveCountMax 3 (15-minute total timeout) Restart with
systemctl restart sshd
and test with
ssh user@ip
—leave idle for 16 minutes; expect disconnection Open port with
firewall-cmd --add-service=ssh --permanent && firewall-cmd --reload
On Vultr this frees resources for MySQL or FTP—verify with
ss -tuln | grep 22
ensuring sshd listens Pair with Fail2ban for security—timeout reduces stalled sessions maintaining uptime on busy servers

Back to All Tips