Skip to content
HostingSquad
To websitehostingsquad.nl
Search
EN

How do I make an SSH connection to my VPS?

Updated on

SSH lets you work on your VPS from the command line. Every VPS includes SSH access at user level: you connect as a DirectAdmin user, and only with an SSH key. SSH access is disabled by default; you enable it yourself for the user you want to connect as.

Before you start

  • You need the login details of the DirectAdmin admin user.
  • You need an SSH key pair. If you do not have one yet, create it on your computer with ssh-keygen -t ed25519. Do not use a DSA key: OpenSSH has not supported DSA since version 10.0.
  • On Windows, you use PowerShell. This requires the OpenSSH client, an optional feature of Windows (from Windows 10 build 1809). To see whether it is installed, run Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*' in PowerShell as an administrator: if OpenSSH.Client shows NotPresent, install it with Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0. Microsoft explains this on this page.
  • DirectAdmin is in English by default, so the menus and buttons in this article are named as you see them on screen. If your DirectAdmin is set to Dutch, DirectAdmin may show the Dutch names, such as Toon Alle Gebruikers instead of Show All Users, Beheer gebruikers pakketten instead of Manage User Packages, Zich voordoen als instead of Impersonate and SSH Sleutels instead of SSH Keys.

Allowing your IP address

SSH can only be reached from an IP address that is on the whitelist of your VPS's firewall. That firewall is csf (ConfigServer Security & Firewall). You can see your IP address on this page (in Dutch).

  1. Log in to DirectAdmin as admin

  2. Open the firewall

    Under Extra Features, click ConfigServer Security & Firewall.

  3. Allow your IP address

    Type your IP address in the field next to Quick Allow and click Quick Allow.

Enabling SSH access

SSH access is a setting of the user's package.

  1. Log in to DirectAdmin as admin

  2. Open Show All Users

    Under Account Manager, click Show All Users.

  3. Open the user

    Click the name of the user you want to connect as via SSH.

  4. Check SSH access and the package

    Click the Account Info tab. Package shows the user's package. Under Features, Shell Access (SSH) shows Enabled or Disabled. If it shows Enabled, continue with "Adding your key" below.

  5. Open Manage User Packages

    Under Account Manager, click Manage User Packages.

  6. Open the package

    Click the name of the user's package. The Edit Package page opens.

  7. Enable SSH access

    Tick SSH Access. The package applies to every user who has it: the other users on this package then get SSH access too.

  8. Save the package

    Click Modify.

Adding your key

  1. Log in to DirectAdmin as admin

  2. Open Show All Users

    Under Account Manager, click Show All Users.

  3. Open the user

    Click the name of the user you want to connect as via SSH.

  4. Continue as the user

    On the user's page, click Impersonate. You are now working in DirectAdmin as this user.

  5. Open SSH Keys

    Under Advanced Features, click SSH Keys.

  6. Paste your public key

    Click Paste Key. In the Paste Authorized Key window, paste the contents of your public key into the Line field. This is the file ending in .pub, for example ~/.ssh/id_ed25519.pub, or on Windows C:\Users\<your name>\.ssh\id_ed25519.pub.

  7. Save the key

    Click Create.

Connecting

You connect using your VPS's hostname. You can find it in the email you received when your VPS was delivered, for example pvm-klantnaam.hsqd.nl.

  1. Open a terminal on your computer

    On Windows, that is PowerShell.

  2. Connect

    Type this command, replacing username with the user's name:

    ssh -p 7198 username@pvm-klantnaam.hsqd.nl

    SSH runs on port 7198 on every VPS.

  3. Confirm the server

    The first time, ssh asks whether you want to continue connecting to this server. Type yes; the server is then added to the list of known servers on your computer.

Not working?
  • After Impersonate, is there no SSH Keys in the menu? Then SSH access is still disabled for this user.
  • If you cannot connect, check that your current IP address is on the whitelist.
  • Can you no longer reach DirectAdmin or your email either? Then you may have been blocked after too many failed login attempts. In that case, send us your IP address.

Still stuck? Contact us (in Dutch).