Connection Issues
Common connection problems and solutions
Having trouble connecting to your server? This guide covers the most common connection problems and how to solve them.
Quick Diagnosis
Before diving into solutions, identify your specific error:
| Error Message | Likely Cause | Jump To |
|---|---|---|
| "Connection timed out" | Network/firewall issue | Timeout Section |
| "Permission denied" | Authentication problem | Permission Section |
| "Network unreachable" | Routing/DNS issue | Network Section |
| "Connection refused" | SSH not running | Refused Section |
| "Host key verification failed" | Security warning | Host Key Section |
Connection Timed Out
What it means: Your computer can't reach the server at all.
Check Server Status
Ping the server:
ping your-server-ip- ✅ Replies received: Server is online, check firewall
- ❌ Request timeout: Server may be down or blocking ICMP
Verify IP Address
Common mistakes:
- Wrong IP address copied
- Server IP changed (dynamic IPs)
- Typo in IP address
Fix:
- Log into your hosting provider's control panel
- Verify the correct IP address
- Check if it's a public or private IP
Check Firewall Rules
Server firewall (UFW/iptables):
# On the server
sudo ufw status
sudo iptables -L | grep 22Ensure port 22 (SSH) is allowed:
sudo ufw allow 22/tcp
sudo ufw reloadCloud provider firewall:
- AWS: Check Security Groups
- DigitalOcean: Check Cloud Firewalls
- GCP: Check VPC Firewall Rules
- Azure: Check Network Security Groups
Make sure inbound TCP port 22 is allowed from your IP.
Network Connectivity
Test from another network:
- Try mobile hotspot instead of WiFi
- Use VPN if behind corporate firewall
- Check if ISP is blocking port 22
Port Number
Is SSH running on a non-standard port?
Some servers use port 2222 or 8022 instead of 22.
Check in CtrlOps:
- Edit server settings
- Verify port number
- Common alternate ports: 2222, 8022, 443
Permission Denied
What it means: Server is reachable, but credentials are rejected.
Wrong Username
Most common mistake! Try these:
root(common default)ubuntu(Ubuntu default)ec2-user(AWS Amazon Linux)centos(CentOS default)debian(Debian default)
Verify username:
# If you have console access
cat /etc/passwd | grep /bin/bashSSH Key Issues
Wrong key file:
- Ensure you're using the correct
.pemor.keyfile - Check key is not corrupted
- Verify key format (OpenSSH vs PEM)
Key permissions too open:
# Fix permissions
chmod 600 ~/.ssh/your-key.pemKey not added to server:
# On server, check authorized_keys
cat ~/.ssh/authorized_keysPassword Authentication
If using password (not recommended):
- Ensure password is correct (case-sensitive!)
- Check if password auth is enabled:
# On server grep PasswordAuthentication /etc/ssh/sshd_config - Some cloud providers disable password auth by default
Account Locked
# Check if user is locked
sudo passwd -S username
# Unlock if needed
sudo passwd -u usernameNetwork Unreachable
What it means: Your computer can't find a route to the server.
DNS Resolution
If using a hostname instead of IP:
nslookup your-hostname.com
dig your-hostname.comFix:
- Use IP address instead of hostname
- Check DNS records are correct
- Wait for DNS propagation (can take 24-48 hours)
Routing Issues
Traceroute to see where connection fails:
traceroute your-server-ip
mtr your-server-ipCommon routing problems:
- VPN conflicts
- Corporate network restrictions
- ISP routing issues
VPN/Proxy Conflicts
Temporarily disable:
- VPN connections
- Proxy settings
- Corporate firewalls
Then test connection again.
Connection Refused
What it means: Server is online, but SSH service isn't accepting connections.
SSH Service Not Running
Check SSH status:
# systemd systems (most modern Linux)
sudo systemctl status ssh
sudo systemctl status sshd
# init.d systems
sudo service ssh statusStart SSH service:
sudo systemctl start sshd
sudo systemctl enable sshd # Auto-start on bootWrong Port
Check SSH port:
# On server
grep Port /etc/ssh/sshd_configCommon scenario: SSH moved to port 443 (to bypass firewalls)
Server Resources Exhausted
Check if server is overloaded:
# On server (via console)
uptime
free -h
df -hIf load is very high (>10x CPU cores), SSH may refuse connections.
Host Key Verification Failed
What it means: Server's identity has changed. Security feature!
Why This Happens
Legitimate reasons:
- Server was rebuilt/reinstalled
- IP address reassigned to different server
- SSH keys regenerated
Malicious reasons:
- Man-in-the-middle attack
- DNS hijacking
How to Fix
Remove old host key:
# Remove specific entry
ssh-keygen -R your-server-ip
# Or edit manually
nano ~/.ssh/known_hosts
# Delete line with your server's IPIn CtrlOps:
- Click the Edit (pencil) icon on the connection card.
- Verify all server details.
- If you have confirmed the key change is legitimate, you may need to manually remove the entry from your local
known_hostsfile as shown above.
Too Many Authentication Failures
What it means: SSH client offered too many keys.
Fix
Specify exact key:
ssh -i ~/.ssh/specific_key.pem user@serverOr disable SSH agent temporarily:
ssh -o IdentitiesOnly=yes user@serverConnection Closes Immediately
Shell Issues
Check user's shell:
grep username /etc/passwdShould be /bin/bash or /bin/sh, not /bin/false or /usr/sbin/nologin
Account Expired
# Check account status
sudo chage -l usernameDebugging Steps
Enable Verbose Mode
Get detailed error information:
ssh -vvv user@server-ipThis shows:
- Which authentication methods tried
- Where connection fails
- Detailed error messages
Check Server Logs
On the server:
# Authentication logs
sudo tail -f /var/log/auth.log # Debian/Ubuntu
sudo tail -f /var/log/secure # CentOS/RHEL
sudo journalctl -u sshd -f # systemdTest from Another Machine
Helps isolate if issue is:
- Client-side (your computer)
- Server-side (SSH config)
- Network-side (firewall/routing)
Prevention
Keep Backups
- Console access credentials
- Alternative connection methods
- Server snapshot before major changes
Monitor SSH
Set up alerts for:
- Multiple failed attempts
- New IP addresses connecting
- Unusual connection times
Use Jump Hosts
For additional security:
Your Computer → Jump Host → Target ServerStill Stuck?
Collect this information for support:
- Exact error message
- Server IP/hostname
- Username trying to connect
- Authentication method (key/password)
- Output of
ssh -vvv - Server logs from
/var/log/auth.log
Still stuck? Contact our engineering team at daxesh@tsttechnology.in.
Pro Tip: Always have a backup way to access your server (console access, different network) before making SSH changes!