How to connect to your LWS VPS with an SSH key

Procédure

To connect to your LWS VPS with an SSH key, all you need to do is generate a key pair on your computer and associate it with your server when reinstalling it. SSH key authentication usefully replaces traditional passwords by offering a much higher level of security against brute-force attacks. In this tutorial, you will see how to create your key, save it in your LWS Panel KVM customer area, reinstall your machine under Debian 13, and connect to it instantly.

Creating the SSH key

  1. Generate your SSH key pair on your computer

    Open your local terminal to generate your cryptographic key pair. Run the generation command by specifying the ed25519 algorithm, which is more modern and secure, along with a comment to identify your computer. Then validate each prompt with Enter to accept the default paths and options without setting a passphrase.

    ⌨ On your computer
    ssh-keygen -t ed25519 -C "mon-ordinateur"
    Expected result
    Generating public/private ed25519 key pair.
    Enter file in which to save the key (/home/tuto/.ssh/id_ed25519):
    Enter passphrase for "/home/tuto/.ssh/id_ed25519" (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/tuto/.ssh/id_ed25519
    Your public key has been saved in /home/tuto/.ssh/id_ed25519.pub
    How to connect to your LWS VPS with an SSH key
  2. Display and copy the contents of the public key

    Display the contents of your public key file in the terminal with the dedicated command. Select the entire displayed line, starting with ssh-ed25519 and ending with your comment, then copy it to your clipboard.

    ⌨ On your computer
    cat ~/.ssh/id_ed25519.pub
    Expected result
    ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKmJbEU1zEwC+gWR5lEhOr9pYfvE1Kls75AmgoZkq2i8 mon-ordinateur

Configuration in the KVM panel

  1. Access the panel's SSH key management

    Switch to your web browser and open your LWS Panel KVM area. In the left-hand side menu, click on the SSH Keys section to open the key configuration page.

    How to connect to your LWS VPS with an SSH key
  2. Add your new SSH key

    On the SSH keys page, click the red + Add an SSH key button. In the window that opens, paste the full contents of your previously copied public key, then confirm to save it. Your key will automatically be labeled Auto-installed.

    How to connect to your LWS VPS with an SSH key

Server reinstallation

  1. Return to the server dashboard

    Once the key is saved and visible in the list, go back up to the left-hand menu and click Dashboard. This takes you back to the overall list of your available virtual machines.

    How to connect to your LWS VPS with an SSH key
  2. Select your virtual server

    In the list of your servers, find your VPS and click directly on its name to display the machine's detailed management page.

    How to connect to your LWS VPS with an SSH key
  3. Open the reinstallation menu

    In the left-hand menu for your machine, click Reinstallation. Take note of the warning displayed at the top of the page reminding you that data will be deleted.

    How to connect to your LWS VPS with an SSH key
  4. Choose Debian 13 and verify the key

    Open the Select the template to install list and choose the Debian 13 (Trixie) option. Check underneath the box that your mon-ordinateur key is indeed selected to be injected into the system.

    How to connect to your LWS VPS with an SSH key
  5. Start and confirm the reinstallation

    Click the Reinstall the server button at the bottom right of the screen. A pop-up window will ask you to type the requested confirmation to permanently start the erase and system installation.

    How to connect to your LWS VPS with an SSH key

SSH connection

  1. Return to your terminal window

    Wait a few moments until the reinstallation is reported as complete on the dashboard. Then switch back to your local terminal window to prepare the connection.

    How to connect to your LWS VPS with an SSH key
  2. Connect to the server via SSH and validate the fingerprint

    Run the SSH command to the root user followed by your server's IP address (replace 203.0.113.10 with the actual IP address of your VPS, available in your customer area). On the very first connection, confirm the server's security fingerprint by typing 'yes' and then validate.

    ⌨ On your computer
    ssh root@203.0.113.10
    Expected result
    The authenticity of host '203.0.113.10 (203.0.113.10)' can't be established.
    ED25519 key fingerprint is SHA256:wYmks+xkf8arSnDfWEvqR7zsgZs86OD0P3vMAX59p3I.
    This key is not known by any other names.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added '203.0.113.10' (ED25519) to the list of known hosts.
  3. Check the system version and disconnect

    You are now connected with root privileges. Verify that the installed system is Debian 13 by displaying the version information, then exit the SSH session by typing 'exit'.

    ⌨ On the server
    cat /etc/os-release
    exit
    Expected result
    PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
    NAME="Debian GNU/Linux"
    VERSION_ID="13"
    VERSION="13 (trixie)"
    VERSION_CODENAME=trixie
    DEBIAN_VERSION_FULL=13.4
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"

Glossary

SSH key
Authentication method based on a pair of cryptographic keys that provides a secure connection without transmitting a password.
Private key
Confidential file stored on your personal machine, used to prove your identity to remote servers.
Public key
Shared file placed on the remote server, allowing it to verify the authenticity of your private key.
ed25519
Modern and efficient cryptographic algorithm recommended for generating secure, compact SSH keys.
KVM Panel
Web-based administration interface provided by LWS to manage, restart, and reinstall your virtual servers.
known_hosts
Local file storing the fingerprints of remote servers you have already connected to in order to verify their identity.

Frequently asked questions

Why use an SSH key rather than a password?

A cryptographic key is practically impossible to guess or brute-force, unlike even a complex password. It also saves you from having to remember or enter credentials at each administration session.

Where can I find my LWS VPS IP address?

Your public IP address is indicated in the server's original delivery email. You can also find it on your KVM panel dashboard, directly in your machine summary.

Why does the terminal ask 'Are you sure you want to continue connecting'?

This is a normal security check when connecting to a new host for the first time. By typing 'yes', you save the machine's fingerprint in your computer's known_hosts file to protect yourself against interception attacks.

Will I need to re-add my SSH key if I order another VPS?

No. Once your key is configured with the 'Auto-installed' status in your KVM panel, it will automatically be deployed to all your future servers created or reinstalled on your LWS account.

help.lws.net/a/7935
Was this article helpful?

Yes

No

Read 1 times

Thank you! Feel free to ask questions about our documentation if you would like more information, and help us improve it.

Similar articles

A question about this article?

Ask the LWS team and the community. Answers are published after moderation.

Ask the LWS team and its community a question

GDPR: Controller: LWS-Ligne Web Services. Purpose: moderation and public publication of your question, possible notification of an answer. Legal basis: consent (Art. 6(1)(a) GDPR). Email retention: 90 days after notification, 12 months maximum without an answer. To exercise your rights, see the GDPR section of our Terms and Conditions.