Cannot Connect to Linux VPS with SSH
Short answerIf SSH will not connect, verify the primary IP in the client area, test nc -zv IP 22, check UFW and sshd status, and use noVNC if locked out. Timeout usually means a firewall drop; immediate refuse means nothing is listening — see Website Shows Connection Refused.
Overview
VPSGrid Linux VPS customers where ssh user@ip hangs or times out — distinct from authentication failures (wrong password) or immediate connection refused.
VPSGrid sells unmanaged VPS with root or administrator access. Guest OS configuration, application data, backups, and patching inside the VM are your responsibility unless a separate product is documented. Review What Is an Unmanaged VPS at VPSGrid? and Security Responsibilities on Unmanaged VPS before expecting support to perform stack work.
VPSGrid provides unmanaged Linux and Windows VPS on US-Based KVM infrastructure with NVMe storage and Proxmox virtualization. You manage the guest OS, applications, backups, and security. Current plan specifications appear at checkout on vpsgrid.net — articles do not publish fixed pricing.
Decision guidance: timeout vs refused vs auth failure
| Symptom | Likely cause | Guide |
|---|---|---|
| Hang then timeout | Firewall filter, wrong IP, network block | This article |
| Connection refused immediately | sshd down or wrong port | Website Shows Connection Refused |
| Permission denied | Wrong password or key | SSH Key Authentication Setup |
Step 1: Verify IP and service status
Confirm VPS status is Active in client area. Copy primary IP — typos cause timeouts to wrong hosts.
ping -c 3 PRIMARY_IPnc -zv PRIMARY_IP 22Step 2: Local network checks
Try SSH from another network (mobile hotspot) to rule out ISP or corporate firewall blocking outbound 22. VPN may also interfere. Optional path trace:
mtr -rwzc 10 PRIMARY_IPStep 3: Guest OS firewall (UFW)
ufw status verboseRun ufw allow OpenSSH (or ufw allow 22/tcp) before ufw enable. Custom SSH port requires ufw allow 2222/tcp matching sshd_config Port directive.
Step 4: sshd service
systemctl status sshTroubleshooting matrix
| Symptom | Likely cause | What to check |
|---|---|---|
| nc timeout | Network or UFW drop | UFW allow 22; verify IP; use noVNC |
| nc refused | sshd down or wrong port | Website Shows Connection Refused |
| Works on hotspot only | Local ISP blocks 22 | Use VPN or alternate SSH port with UFW allow |
| Auth fails after connect | Credentials/keys | SSH Key Authentication Setup |
Verify
- Successful
ssh root@PRIMARY_IPor sudo user login with stable session - UFW shows allow rule for SSH port in use
- sshd active:
systemctl is-active sshreturns active
Security considerations
Prefer SSH keys over passwords — Basic Linux VPS Security Checklist. Fail2ban reduces brute force after opening port 22 — Fail2ban Setup on VPSGrid Linux VPS.
ISP and corporate firewall blocks on port 22
Some ISPs block outbound port 22 on residential connections. Corporate networks may require VPN. Symptom: timeout from office, works from mobile hotspot. Remediation: VPN, alternate SSH port with UFW allow, or jump host — not a VPSGrid infrastructure defect.
VPSGrid infrastructure vs guest OS scope
If primary IP is correct, nc to port 22 times out from multiple networks, and UFW/sshd are confirmed via noVNC, open a support ticket with service ID, primary IP, nc output, and mtr summary. Support verifies hypervisor networking — you verify guest OS firewall and sshd.
Capture baseline metrics first
Save command output before changes so you can compare after remediation and attach evidence to support tickets if needed.
Read-only diagnosis first
Prefer inspection commands that do not delete data until you identify root cause.
External monitoring correlation
Match external uptime monitor timestamps with auth and application logs.
Next learning step
Harden access with SSH Key Authentication Setup after SSH works.
Frequently Asked Questions
Why does SSH timeout to my VPSGrid VPS?
Common causes: wrong IP, local firewall, VPSGrid-side UFW blocking port 22, sshd not running, network issue, or ISP blocking outbound 22. Verify primary IP in client area and see How to Connect via SSH to Your VPSGrid Linux VPS.
Should I open SSH to the world?
Many admins allow port 22 globally with key-based auth and Fail2ban — Fail2ban Setup on VPSGrid Linux VPS. Restricting to your IP in UFW reduces brute force noise.
Can VPSGrid fix SSH for me?
Support assists with infrastructure reachability. Guest OS sshd configuration, UFW, and keys inside the VM are customer responsibility per Security Responsibilities on Unmanaged VPS.
SSH timeout vs connection refused?
Timeout often means packets dropped (firewall/filter). Connection refused means host reachable but nothing listens on port 22 — see Website Shows Connection Refused.
Related Articles
Next steps on VPSGrid
Prepare your environment on a VPSGrid Linux VPS when you are ready — verify primary IP in the client area before troubleshooting SSH.
Need More Help?
Search this knowledgebase for related guides. If the issue appears infrastructure-related (provisioning, billing, primary IP assignment), open a ticket at billing.vpsgrid.net with your service ID, primary IP, and steps already tried. See What Information to Include in a Support Request and Security Responsibilities on Unmanaged VPS for scope.
Was this answer helpful?