How to Connect to a VPS via SSH: Step-by-Step Guide
To connect to a VPS via SSH, you need the server IP address, a username, and either a password or an SSH key. On Windows, you can connect through Terminal or PuTTY. On macOS and Linux, use the built-in terminal with the command ssh root@IP_address. After entering the password, you will access the server command line with full root privileges.
What Is SSH and Why Is It Needed?
SSH (Secure Shell) is a protocol for secure remote access to a server over an encrypted connection. It allows you to manage a VPS from the command line: install software, edit configuration files, start and stop services, and perform administrative tasks as if you were working directly on the server.
What You Need to Connect
- The server IP address — provided by the hosting provider in an email or in the control panel.
- A username, usually
root. - A password or private SSH key provided when the VPS was ordered.
- An SSH client — on macOS and Linux it is built into the terminal, while on Windows you can use PuTTY or the built-in Windows 10/11 terminal with OpenSSH support.
How to Connect to a VPS from Windows
- Open Terminal or PowerShell. Starting with Windows 10, the OpenSSH client is usually available by default.
- Enter the command
ssh root@your_IP_addressand press Enter. - When connecting for the first time, the system will ask you to confirm that you trust the server. Type
yesand press Enter. - Enter your VPS password. The characters will not be displayed on the screen — this is normal. Press Enter after typing the password.
- After successful authentication, you will see the server command line. The SSH connection is now established.
If you prefer a graphical SSH client, you can use PuTTY. Enter the server IP address in the Host Name field, specify port 22, select SSH as the connection type, click Open, and enter your username and password in the window that appears.
How to Connect to a VPS from macOS and Linux
- Open the Terminal application.
- Enter the command
ssh root@your_IP_address. - Confirm that you trust the server by typing
yesduring the first connection. - Enter the VPS password and press Enter.
- After authentication, the server command line will open.
How to Connect Using an SSH Key Instead of a Password
An SSH key is a more secure authentication method than a password because it helps protect against password brute-force attacks. A key pair consists of a private key, which remains on your computer, and a public key, which is added to the server.
- Generate a key pair with the command
ssh-keygen -t ed25519. - Save the key in the default location and, if desired, set a passphrase for additional protection.
- Copy the public key to the server using
ssh-copy-id root@your_IP_address, or manually add its contents to the~/.ssh/authorized_keysfile on the VPS. - Connect using
ssh root@your_IP_address. If everything is configured correctly, the server should no longer ask for the account password.
Common SSH Connection Problems
- Connection refused — the server may not be running yet, or the SSH port may be blocked by the firewall.
- Connection timed out — there may be a network issue, an incorrect IP address, or a connection block on the internet provider's side.
- Permission denied — the username, password, or SSH key may be incorrect, or root login may be restricted by the server security settings.
- Host key verification failed — the server key has changed, for example after reinstalling the operating system. You need to remove the old entry from the
known_hostsfile on your computer.
Frequently Asked Questions
Which Port Does SSH Use by Default?
SSH uses port 22 by default. Some administrators change it to a non-standard port to reduce automated scanning attempts.
Can I Connect to a VPS from a Phone?
Yes. Mobile SSH clients such as Termius or JuiceSSH allow you to manage a server directly from a smartphone.
What Should I Do If I Forgot My VPS Password?
You can usually reset the password through your hosting provider's server control panel or contact technical support to restore access.
Is It Safe to Connect via SSH Without a VPN?
Yes. SSH traffic is encrypted, so a direct SSH connection is secure without a VPN. Additional protection is mainly useful for limiting who can attempt to access the server in the first place.
Connecting to a VPS via SSH takes only a few minutes and works in almost the same way on Windows, macOS, and Linux. All ForceVPS VPS plans include root access and ready-to-use SSH connection details immediately after purchase, including the high-performance NVMe VPS line for projects with higher speed requirements.