SSH Access to VPS
SSH (Secure Shell) allows you to remotely connect to your VPS and manage it securely from your local machine. This guide explains how to connect from different operating systems and apply basic security practices.Requirements
Before connecting, make sure you have:- Your VPS public IP address
- A username (usually
root) - The VPS password or an SSH private key
- An SSH client on your device
Connecting from Linux or macOS
Most Linux and macOS systems include SSH by default. Open a terminal and run:yes and press Enter.
Enter your password when prompted.
Connecting from Windows
Using PowerShell or Windows Terminal
Modern versions of Windows include an SSH client by default. Open PowerShell or Windows Terminal and run:Using PuTTY
- Open PuTTY.
- Enter your VPS IP address in the Host Name field.
- Set the port to
22. - Ensure the connection type is set to SSH.
- Click Open.
- Log in using your username and password.
Using SSH Key Authentication (Recommended)
SSH key authentication is more secure than password-based login.Generate an SSH Key on Your Local Machine
Add the Public Key to Your VPS
Log in to your VPS using password authentication, then run:Disable Password Authentication (Optional but Recommended)
After confirming SSH key login works, you can disable password authentication. Edit the SSH configuration file:Common SSH Issues
- Connection refused SSH service may not be running or port 22 is blocked by a firewall.
- Permission denied Incorrect username, password, or SSH key permissions.
- Connection timed out Incorrect IP address or network-level firewall restrictions.
Security Best Practices
- Use SSH keys instead of passwords
- Keep your system updated
- Restrict SSH access using firewalls
- Avoid exposing unnecessary services to the public internet
What to Do Next
After connecting successfully, you can:- Install required software and services
- Configure firewalls and security rules
- Set up backups and monitoring
- Prepare the VPS for production workloads