Skip to main content

Walkthrough · Intermediate · 20 minutes

How to Connect to a VPS with SSH

How to reach the command line safely, then stop using a password to get there, without the guessing — the steps in order, the snag ahead of time, and the tip our support team repeats daily.

The short answer

The job: reach the command line safely, then stop using a password to get there. Time to set aside: 20 minutes. Skill needed: intermediate.

Below are the precise steps, the classic stumble, and one tip from the support desk. Wherever the platform already does a step for you, the guide says so rather than handing you a machine's chores.

By the Hosting & Domains team · Reviewed 18 August 2026

Intermediate

Experience required

5

Stages, start to finish

Free

Support included

Proven

On the platform itself

No technical background needed. This walkthrough was written for first-timers, proven on our own hardware, and honest about which parts are genuinely tricky rather than merely unfamiliar.

First rule: read the snag section before you start, not afterwards. It was distilled from the tickets of everyone who tried the other order.

The whole job in one view

Over the whole job, you will collect the three details, open the connection, generate a key pair, install the public key on the server and turn password login off.

Every stage is a few minutes of unhurried clicking — the total depends mostly on how well you already know the control panel. The detailed instructions are further down; read the whole path once before you begin.

The well-worn snag

Turning passwords off from your only session before the key has been tested. Get it wrong and you are locked out of your own server. Keep the working session open and prove the new method in a second window, every time, without exception.

It earns a section of its own because it is no obscure edge case — it is the single commonest reason this task reaches a support queue. Knowing it in advance turns the whole job from risky into routine.

A habit worth borrowing

Record the connection in ~/.ssh/config under a short host alias. One entry replaces the address, the user, the port and the key path, so a single word gets you in and nobody is tempted to store the password somewhere convenient.

Habits this small are what separate the people who find hosting effortless from the people who find it draining. The same tools on both sides — a different way of working.

What a Hosting & Domains plan spares you

Some steps in this guide exist only because hosting traditionally forced them on you. Here the SSL issues itself, the copy is taken daily without being asked, and one-click installers remove the manual setup. What is left is the part that was always genuinely yours.

Should a step still misfire, support answers at any hour with an actual fix rather than a knowledge-base link and a shrug. Half the guides on this site began as repeat patterns in our ticket queue.

The clustered hardware the cloud servers are carved out of

The hosting these steps were tested on

Tutorials written against imaginary hosting go stale fast. Ours are written against the real thing: the same panel, installer and defaults waiting in your account.

The rate you register at is the rate you renew at, so year two costs precisely what year one did — nothing lying in wait on the invoice.

  • Every step checked exactly as published
  • The snag named before it arrives
  • The dull steps taken out of your way
  • People reachable at any hour you stall

Why Hosting & Domains

Standard on every plan

Taken from real tickets

These guides came out of the support queue, so every snag flagged is one people genuinely hit.

Help that keeps your hours, not ours

Stuck on step three at midnight? Support answers at any hour, mid-walkthrough included.

The dull parts automated

SSL, backups and installs look after themselves here, leaving the guide to cover only what is genuinely yours.

The snag, flagged up front

The classic error for this particular task is named before step one, which is how 20 minutes stays 20 minutes.

Works exactly as printed

Every step is proven on the platform we run — none of the 'your host may vary' hedging.

Every undo written out

Any step that could bite is marked, together with the exact way to wind it back.

Quick Start

Order placed to site online

  1. 1

    Collect the three details

    The server's IP address, the username, which is root on a fresh build, and the port, 22 unless it has been changed. All three come in the provisioning email, and nothing else is needed for a first connection.

  2. 2

    Open the connection

    From a terminal on macOS, Linux or Windows: ssh root@your-server-ip. Accept the host fingerprint the first time; after that, a changed fingerprint is a warning worth stopping for.

  3. 3

    Generate a key pair

    Running ssh-keygen -t ed25519 locally produces a private key that stays on your machine and a public one that travels. Put a passphrase on the private key, since it is the single secret that matters in this whole exercise.

  4. 4

    Install the public key on the server

    ssh-copy-id root@your-server-ip appends it to the server's authorised keys. Open a second terminal and confirm the key works before you close the session you already have.

  5. 5

    Turn password login off

    Once the keys are proven, put PasswordAuthentication no into sshd_config and reload the service. From then on, brute-force attempts are just noise in a log instead of a race that might one day go against you.

Built In

Fitted to every plan

  • SSH, Git and Composer on the developer plans
  • Spam and virus screening on every mailbox by default
  • PHP versions set per site from the control panel
  • The name's first year included when you order annually
  • WordPress and 400+ further applications installed in one click
  • NVMe SSD storage on every tier, not only the dear ones
  • A renewal figure identical to the one you registered at
  • DDoS filtering absorbed at the network edge
  • Money back within 30 days on hosting plans, 7 on reseller
  • WordPress Toolkit, with the updates seen to for you

Frequently Asked

The questions that come up most

Is changing the SSH port worth doing?

It cuts log noise dramatically but is not security in itself, since a scan finds the new port in seconds. Key-only authentication is the control that actually stops intrusions. Move the port if quieter logs help you notice real events, but never treat it as the defence.

What if I lose the private key?

That way in is gone, which is exactly why a second key or a console route wants arranging before the day you need it. Out-of-band console access comes with our VPS plans, which makes a lockout a recoverable afternoon instead of a rebuild. Back the key up somewhere encrypted on the day you create it.

Will the renewal cost more than the first term?

No. The rate you order at is the rate you renew at, year after year. There is no introductory teaser here, so no second-year jump is waiting — the hosting line stays a fixed figure your accounts can plan around.

How do payments and auto-renewal work?

You pay by credit or debit card through a secure checkout, and renewals bill at the same rate as the original order. Every invoice sits in your client area, and auto-renewal switches off with a toggle in the account — no telephone call needed.

Keep reading

Changing hosts? Run through our checklist first.

A plain order of work for a move nobody visiting will notice: which files go over first, how to carry the mail across without losing a message, when exactly to repoint DNS, and the two mistakes behind nearly every outage we are asked to rescue.

What arrives is the checklist, and then the occasional note on keeping a site quick. Leave whenever you like; the privacy policy covers the rest.

Do it properly this time.

Free SSL, a free migration, renewals billed at the original rate, and people on support around the clock. That is the whole of it.

View DirectAdmin Reseller Hosting plans