# How to connect to a Linux server with SSH

> How to connect to a Linux VPS or dedicated server with SSH from Windows, macOS or Linux, then switch from passwords to SSH keys, step by step.

Source: https://lowcostserv.com/guides/connect-to-a-server-with-ssh · Publisher: LowCostServ (lowcostserv.com) · Prices in US dollars, as published on November 26, 2026.

Log in to a new VPS or dedicated server from Windows, macOS or Linux, then switch from passwords to SSH keys.

By LowCostServ · Updated November 12, 2026 · 3 min read

SSH is how you talk to a Linux server: an encrypted terminal session between your computer and the machine. This guide takes you from the access details in your client area to a passwordless, key-based login. The examples use `203.0.113.10` as the server address; replace it with yours.

## What you need

- The **IP address** of your server, from the Services page of your client area.
- The **username**, normally `root` on a new server.
- The **password** shown on the same page. You will replace it in a few minutes.

## Connect for the first time

macOS, Linux and Windows 10 or 11 all ship with an SSH client. Open Terminal (or PowerShell on Windows) and run:

```
ssh root@203.0.113.10
```

The first time, SSH shows the server’s fingerprint and asks whether to continue. Type `yes`. From then on your computer remembers the server and warns you if its identity ever changes. Enter the password when asked; nothing appears on screen as you type, which is normal.

**On an older Windows?** Install PuTTY, enter the IP address in “Host Name”, keep port 22 and click Open.

## Switch to SSH keys

A password can be guessed; a key cannot, in any practical sense. A key pair has two halves: a private key that stays on your computer, and a public key that you place on the server.

### 1. Create a key on your computer

```
ssh-keygen -t ed25519 -C "my-laptop"
```

Press Enter to accept the default location. A passphrase is optional but recommended: it protects the key if your computer is stolen.

### 2. Copy the public key to the server

On macOS and Linux:

```
ssh-copy-id root@203.0.113.10
```

On Windows PowerShell, which has no `ssh-copy-id`:

```
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh root@203.0.113.10 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
```

### 3. Test it

```
ssh root@203.0.113.10
```

You should get a shell without being asked for the server password.

## Turn password logins off

Once the key works, close the door that bots are knocking on. On the server:

```
echo "PasswordAuthentication no" > /etc/ssh/sshd_config.d/10-keys-only.conf
sshd -t && systemctl restart ssh
```

On AlmaLinux and Rocky Linux the service is called `sshd` instead of `ssh`.

**Keep your current session open** and test the login from a second terminal before you close it. If something is wrong you can still fix it.

## A shortcut for next time

Add an entry to `~/.ssh/config` on your computer:

```
Host myserver
    HostName 203.0.113.10
    User root
    IdentityFile ~/.ssh/id_ed25519
```

From now on, `ssh myserver` is enough. The same name works with `scp`, `rsync` and most editors.

## When it does not work

| Message | Usual cause | Fix |
| --- | --- | --- |
| `Connection timed out` | Wrong IP address, or a firewall in between | Check the address; try from another network |
| `Connection refused` | The server is still starting, or SSH is not running | Wait a minute and retry |
| `Permission denied (publickey)` | The server does not have your public key | Repeat step 2, or log in from the computer that has the key |
| `REMOTE HOST IDENTIFICATION HAS CHANGED` | You reinstalled the server, so its fingerprint is new | `ssh-keygen -R 203.0.113.10`, then connect again |

## Next step

You are logged in as root with a key. Before installing anything, spend fifteen minutes on the basics: updates, a normal user and a firewall. That is the subject of [Secure a new Linux server in 15 minutes](https://lowcostserv.com/guides/secure-a-new-linux-server).

## Sources and further reading

- [OpenBSD manual: ssh(1)](https://man.openbsd.org/ssh)
- [OpenBSD manual: ssh-keygen(1)](https://man.openbsd.org/ssh-keygen)
- [OpenBSD manual: sshd_config(5)](https://man.openbsd.org/sshd_config)
- [OpenBSD manual: ssh_config(5)](https://man.openbsd.org/ssh_config)

**Put it into practice**

- [**Cloud VPS**: Cloud VPS from $3.99/mo with an unmetered 1 Gbps port.](https://lowcostserv.com/vps)
- [**Dedicated servers**: Whole Ryzen and EPYC machines from $59/mo.](https://lowcostserv.com/dedicated-servers)

**Keep reading**

- [**How to secure a new Linux server in 15 minutes**: Security · 4 min read](https://lowcostserv.com/guides/secure-a-new-linux-server)
- [**How to set up your own WireGuard VPN on a VPS**: Security · 3 min read](https://lowcostserv.com/guides/set-up-wireguard-vpn)
- [**How to pay for hosting with Bitcoin**: Crypto and payments · 4 min read](https://lowcostserv.com/guides/pay-for-hosting-with-bitcoin)

## Read next Two guides to follow this one.

[All getting started guides](https://lowcostserv.com/guides/topic/start)

- [How to connect to a Windows RDP server](https://lowcostserv.com/guides/connect-to-windows-rdp): Open a remote desktop session from Windows, macOS, Linux, iPhone or Android, and fix the usual connection errors. (Getting started, 3 min read, Nov 12, 2026)
- [DMCA takedowns explained, and what DMCA-ignored hosting means](https://lowcostserv.com/guides/dmca-takedowns-explained): How a DMCA notice works, why hosts suspend first and ask later, and what “DMCA-ignored” hosting does and does not cover. (Privacy and policy, 4 min read, Nov 12, 2026)

## Your own server, in a few minutes.

Cloud VPS from $3.99 a month: no email, no ID, crypto payment, root access in minutes.

- **No KYC**: No email, no ID
- **No DMCA**: Notices not acted on
- **Crypto friendly**: BTC, ETH, XMR, USDT, SOL
- **Unmetered**: On every plan

---

LowCostServ rents cloud VPS, dedicated servers, GPU servers and Windows RDP servers and registers domain names, with no identity check and payment in crypto. Every plan and price: https://lowcostserv.com/pricing.md · The company in facts: https://lowcostserv.com/about.md · Index of the site for language models: https://lowcostserv.com/llms.txt
