Home / Linux / How to Connect to Your VPS via SSH (Windows PowerShell & Terminal)

How to Connect to Your VPS via SSH (Windows PowerShell & Terminal)

A beginner-friendly (“for dummies”) guide to connecting to a VPS using SSH from Windows PowerShell or a terminal. Includes exact commands, what each one does, what you should see, and common fixes.

Views: 57 Unique: 35 Updated: 2026-03-20

Introduction

SSH (Secure Shell) is the standard way to connect to a Linux VPS and manage it securely from a command-line terminal. In this guide you will learn how to connect using Windows PowerShell (Windows 10/11) or a Terminal (macOS/Linux).

This is a “for dummies” tutorial: copy/paste commands exactly as shown. Every command includes:

  • What it does
  • Why it is needed
  • What you should expect
  • Warnings / notes

Prerequisites

  • Your VPS IP address (example: 203.0.113.10)
  • A valid username (commonly root or ubuntu)
  • One of these authentication methods:
    • Password (less recommended)
    • SSH key (recommended)
  • SSH client:
    • Windows: PowerShell (built-in SSH on Windows 10/11)
    • macOS/Linux: Terminal

Step-by-step (extremely detailed)

Step 1) Open PowerShell (Windows) or Terminal (macOS/Linux)

  • Windows: Press Win → type PowerShell → open it.
  • macOS: Applications → Utilities → Terminal.
  • Linux: Open your terminal app.

Expected result: A window where you can type commands.

Step 2) Basic connection (password login)

Command:

ssh USERNAME@YOUR_SERVER_IP

Example:

ssh root@203.0.113.10

What it does: Starts an encrypted SSH session to your server.

Why it is needed: This is the main command to connect and control the VPS.

What you should expect:

  • The first time, you may see a message like: Are you sure you want to continue connecting (yes/no/[fingerprint])?
  • Type yes and press Enter.
  • Then you may be asked: root@203.0.113.10's password: (type your password; it will not show on screen)
  • If successful, your prompt changes to something like root@hostname:~# or user@hostname:~$

Warning: Password SSH is convenient but less secure. Use SSH keys when possible.

Step 3) Recommended: connect using an SSH key (more secure)

SSH keys work like a secure “digital key” instead of a password.

3.1 Generate a key (on your computer)

Command:

ssh-keygen -t ed25519 -C "your_email@example.com"

What it does: Creates a new SSH key pair (private + public).

Why it is needed: The private key stays on your PC; the public key is added to the server. Then you can log in securely.

What you should expect:

  • It asks where to save the key. Press Enter to accept the default location.
  • It asks for a passphrase (recommended). You can enter one or leave empty.
  • It prints something like: Your identification has been saved in ...

Important note: Never share your private key.

3.2 Copy your public key to the server

Option A (macOS/Linux, easiest):

ssh-copy-id USERNAME@YOUR_SERVER_IP

Example:

ssh-copy-id root@203.0.113.10

What it does: Adds your public key to ~/.ssh/authorized_keys on the server.

Expected result: It may ask for your password once, then confirms keys were added.

Option B (Windows PowerShell):

First, print your public key:

type $env:USERPROFILE.sshid_ed25519.pub

What it does: Displays your public key text.

Next: Copy the output, then connect to the server with password and run:

mkdir -p ~/.ssh
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys

Paste the key on a new line, save, and then run:

chmod 600 ~/.ssh/authorized_keys

Why these permissions matter: SSH refuses to use keys if the .ssh directory or files are too open.

3.3 Connect using the key

Command:

ssh USERNAME@YOUR_SERVER_IP

Expected result: You should log in without typing the server password (you may type your key passphrase instead).

Useful SSH options (optional)

Specify a custom port

Command:

ssh -p 2222 USERNAME@YOUR_SERVER_IP

What it does: Connects using port 2222 instead of the default 22.

Use a specific private key file

Command:

ssh -i ~/.ssh/id_ed25519 USERNAME@YOUR_SERVER_IP

What it does: Forces SSH to use the selected private key file.

Troubleshooting (common beginner problems)

1) “Permission denied (publickey,password)”

  • Meaning: The server rejected your login method.
  • Fix checklist:
    • Confirm the username is correct (e.g., root vs ubuntu).
    • If using a key, make sure your public key is in ~/.ssh/authorized_keys on the server.
    • Check permissions: chmod 700 ~/.ssh and chmod 600 ~/.ssh/authorized_keys.

2) “Connection timed out”

  • Meaning: Your computer cannot reach the server.
  • Common causes: Wrong IP, firewall blocking port 22, VPS offline, wrong SSH port.
  • Try: Verify the IP and try from another network. If you changed the SSH port, connect with -p.

3) “REMOTE HOST IDENTIFICATION HAS CHANGED!”

  • Meaning: The server fingerprint changed (common after reinstalling the VPS). SSH is warning you for security.
  • Fix (if you are sure it is your server):
ssh-keygen -R YOUR_SERVER_IP

What it does: Removes the old fingerprint from your local known_hosts file.

Conclusion

You now know how to connect to your VPS using SSH from Windows PowerShell or a Terminal. Once you can connect reliably, you can safely manage your server (updates, firewall, websites, databases, etc.).

Back to category