Skip to content

Connection Failed

Troubleshooting guide for SSH connection failures.

Common Errors

Connection Timeout

Symptoms: Connection times out without response

Possible Causes:

  • Wrong server address or port
  • Network unreachable
  • Firewall blocking
  • SSH service not running

Solutions:

  1. Verify server address and port
  2. Check network connectivity
  3. Test with ping or telnet
  4. Check firewall rules
  5. Verify SSH service status

Connection Refused

Symptoms: Connection immediately refused

Possible Causes:

  • SSH service not running
  • Wrong port number
  • Service crashed

Solutions:

  1. Check SSH service status
  2. Verify port configuration
  3. Restart SSH service
  4. Check service logs

Host Key Verification Failed

Symptoms: Host key mismatch warning

Possible Causes:

  • Server reinstalled
  • IP address changed
  • Security attack

Solutions:

  1. Confirm server change is legitimate
  2. Delete old host key
  3. Re-accept new fingerprint

Authentication Errors

Permission Denied

Symptoms: Authentication failed

Possible Causes:

  • Wrong username
  • Wrong password
  • Wrong key file
  • Server configuration

Solutions:

  1. Verify username
  2. Check password
  3. Check key file path
  4. Verify server allows this user

Key Authentication Failed

Symptoms: Key authentication rejected

Possible Causes:

  • Wrong key file
  • Wrong key format
  • Missing passphrase
  • Key not authorized

Solutions:

  1. Verify key file path
  2. Check key format
  3. Enter correct passphrase
  4. Add key to authorized_keys

Network Issues

Firewall Blocking

Symptoms: Cannot reach server

Solutions:

  1. Check local firewall
  2. Check server firewall
  3. Check network firewall
  4. Open SSH port (22)

Network Unreachable

Symptoms: Network error

Solutions:

  1. Check network connection
  2. Verify routing
  3. Check DNS resolution
  4. Use correct IP address

Diagnostic Steps

Step 1: Basic Connectivity

Test basic connectivity:

bash
ping server_address
telnet server_address 22

Step 2: SSH Service

Check SSH service:

bash
# On server
systemctl status sshd
netstat -tlnp | grep 22

Step 3: Logs

Check logs:

bash
# On client
cat ~/.ssh/known_hosts

# On server
tail -f /var/log/auth.log

Advanced Troubleshooting

Debug Mode

Run SSH in debug mode:

bash
ssh -vvv user@server

Network Tools

Use network tools:

bash
traceroute server_address
nmap -p 22 server_address

Prevention

  • Keep connection info updated
  • Use stable network
  • Configure keep-alive
  • Monitor connection status

BShellX Pro Documentation