Select your language

In the following article, we’ll show you how to generate an SSH key for Windows 11 and Mac and use it to establish an SSH connection.

The advantage of logging in with an SSH key is that you do not need to use or potentially disclose to others your web hosting password for this. You can create a specific SSH key for each person (e.g. for yourself and for your webmaster).

You can also add the same SSH key to multiple web hostings, so you don’t have to remember different passwords.

Windows

Generating an SSH key

To log in with an SSH key, the key must first be generated and saved.

  1. Enter “Power” in the Search field in the taskbar located at the bottom of the screen and click “Open” in the right pane. The PowerShell console opens and your home directory is displayed: PS C:\Users\your_home_directory
  2. Create a new directory in your home directory with the following command:
    mkdir .ssh
  3. Change to the new directory with the following command:
    cd .ssh
  4. Generate an SSH key in the new directory with the following command:
    ssh-keygen -t ed25519
  5. Think up a secure passphrase and enter it twice.

    Important
    : Make sure you can remember the passphrase, because this must be entered once when logging in to the SSH client. If you forget it, the existing private key can no longer be used. In this case, you must generate a new SSH key and upload the public key to the server again.

  6. Press the Enter key.

→ The SSH key pair (private key and public key) has been generated and stored on your computer.

Copying the SSH key to the server

Now you have to copy the SSH key to the server. You can do this directly in the PowerShell. Alternatively, you can also add the SSH key in the Hostpoint Control Panel.

PowerShell

  1. If you are still in the directory PS C:\Users\info\.ssh>, type cd ../../.. and press the Enter key again. You are now in the directory PS C:\> .
  2. To copy the generated key to your server, type the following command:
    type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh -m hmac-sha2-512 MainAccount@MainAccount.ssh.cloud.hostpoint.ch "cat >> .ssh/authorized_keys"
  3. After entering this command, you will be prompted for a password. Now enter the password for the main account. 
  4. Close all open PowerShell windows.

→ The SSH key has been copied to the server.

Hostpoint Control Panel 

  1. Open Windows PowerShell and open the public key in PowerShell using the following command:
    Get-Content "$env:USERPROFILE\.ssh\id_ed25519.pub"
  2. Use the mouse to select the text and copy it to the clipboard.
  3. In the Hostpoint Control Panel, you can add it under “Advanced” > “SSH Access” > “Edit SSH Authorized Keys”:
    Webhosting SSH Zugang en
  4. Paste the text from the clipboard into the “Authorized Keys” field and save it by clicking the “Save” button. 

→ The SSH key has been copied to the server.

Establishing an initial connection

  1. Enter the following command to establish a connection via SSH key for the first time:
    PS C:\Users\your_home_directory\.ssh> ssh -m hmac-sha2-512 MainAccount@MainAccount.ssh.cloud.hostpoint.ch
  1. Enter your personal passphrase.
  2. When you connect to a server for the first time using SSH, you may be asked whether you want to trust the “fingerprint”.

    For security, you can compare the IP address in the message with the IP address in your DNS zone. You can then establish the connection by entering “yes”. You can find out how to have our fingerprints checked automatically in our article “What are common problems in accessing with SSH?”.

    → If a connection has been successfully established, you will see the following page:
    SSH Verbindung hergestellt
  3. You have now connected to the server using the saved SSH key without having to enter a password. 

Saving your connection data

For even greater convenience, you can save your connection data in the SSH configuration file. This way, you will no longer have to enter the data if you want to establish an SSH connection.

Follow these steps:

  1. Create a file with the name config in the C:\Users\your_home_directory\.ssh directory by right-clicking there in Explorer and selecting “New” > “Text Document”. Please make sure that you first click on “View” > “Show” > “File name extensions” in the ribbon to see the file extension .txt.
  2. Open the file by double-clicking it and edit it as follows:
WhatValues
Hosthostpoint (user-definable)
HostNameMainAccount.ssh.cloud.hostpoint.ch
UserMainAccount
Port22
MACshmac-sha2-512

As always, you need to replace MainAccount with your username.

The content of the file then looks like this, for example:

~/config
Host hostpoint
  HostName MainAccount.ssh.cloud.hostpoint.ch
  User MainAccount
  Port 22
  MACs hmac-sha2-512
  1. Save and close the file.
  2. Remove the file extension .txt and confirm.
  3. You can now hide the file name extensions again if you want.

→ The configuration file has been saved. The next time you want to connect to the server via SSH, all you need to do is enter the command ssh hostpoint. The required connection data is then automatically retrieved from the file. All you have to do then is enter your personal passphrase once and you are connected.

Mac

Generating an SSH key

To log in with an SSH key, the key must first be generated and saved.

  1. Search for the “Terminal” app and launch it. Your Mac’s console will open.
  2. Generate an SSH key with the following command:
    ssh-keygen -t ed25519

    Important: By default, this command names the SSH key “ed25519” If you want to create more than one SSH key, we recommend creating the second SSH key using the following command: 
    ssh-keygen -t ed25519 -C SSHkeyName


    Using the -C option, you can give the SSH key a custom name. Instead of “SSHkeyName” you can enter the desired name for the SSH key. 

  3. You will be asked where to save the key:
    Enter file in which to save the key (/Users/username/.ssh/id_ed25519):
  4. Confirm the save location by pressing ENTER, or enter a different directory if desired.

    By default, SSH keys on Mac are stored in the /Users/username/.ssh/ directory. That is the location we recommend.

  5. Think up a secure passphrase and enter it twice.

    Important: Make sure you can remember the passphrase, because this must be entered once when logging in to the SSH client. If you forget it, the existing private key can no longer be used. In this case, you must generate a new SSH key and upload the public key to the server again.

  6. Press ENTER again.

→ The SSH key pair (private key and public key) has been generated and stored on your computer.

Copying the SSH key to the server

Now you have to copy the SSH key to the server. You can do this directly in the Terminal. Alternatively, you can also add the SSH key in the Hostpoint Control Panel.

Terminal

  1. To copy the generated key to your server, open the Terminal and type the following command: 
    ssh-copy-id MainAccount@MainAccount.ssh.cloud.hostpoint.ch
  2. After entering this command, you will be prompted for a password. Now enter the password for the main account. 
  3. Close all open Terminal windows.

→ The SSH key has been copied to the server.

Hostpoint Control Panel 

  1. Open the Terminal again and open the public key in the Terminal using the following command:
    cat .ssh/id_ed25519.pub
  2. Use the mouse to select the text and copy it to the clipboard.
  3. In the Hostpoint Control Panel, you can add it under “Advanced” > “SSH Access” > “Edit SSH Authorized Keys”:
    Webhosting SSH Zugang en
  4. Paste the text from the clipboard into the “Authorized Keys” field and save it by clicking the “Save” button.

→ The SSH key has been copied to the server.

Establishing an initial connection

  1. Enter the following command to establish a connection via SSH key for the first time:
ssh MainAccount@MainAccount.ssh.cloud.hostpoint.ch
  1. Enter your personal passphrase.
  2. When you connect to a server for the first time using SSH, you may be asked whether you want to trust the “fingerprint”.

    For security, you can compare the IP address in the message with the IP address in your DNS zone. You can then establish the connection by entering “yes”. You can find out how to have our fingerprints checked automatically in our article “What are common problems in accessing with SSH?”.

    → If a connection has been successfully established, you will see the following page:
    SSH Verbindung hergestellt
  3. You have now connected to the server using the saved SSH key without having to enter a password.
Please use this form only to provide feedback on the above guide.
For support requests please use this form instead.

 

 

© 2001 - Hostpoint AG
Cookie

Wir verwenden Cookies  🍪

We use Cookies  🍪

Nous utilisons des cookies  🍪

Utilizziamo dei cookie  🍪

Die digitalen Auftritte von Hostpoint (Website, Control Panel, Support Center etc.) verwenden Cookies. Diese werden dazu verwendet, um Daten über Besucherinteraktionen zu sammeln. Wenn Sie auf «Akzeptieren» klicken, stimmen Sie der Verwendung dieser Cookies für Werbezwecke, Website-Analyse und Support zu. Gewisse essenzielle Cookies sind jedoch für eine ordnungsgemässe Funktion dieser Seiten unerlässlich und können deshalb nicht deaktiviert werden. Auch ohne Ihre Zustimmung können gewisse Daten in anonymisierter Form für statistische Zwecke und zur Verbesserung unserer Websites verwendet werden. Bitte beachten Sie unsere Datenschutzerklärung.

Hostpoint's digital presences (website, Control Panel, Support Center, etc.) use cookies. These are used to collect data on visitor interactions. If you click “Accept”, you agree to the use of these cookies for advertising purposes, website analysis and support. However, certain cookies are essential for the proper functioning of these pages and therefore cannot be disabled. Even without your consent, certain data may be used in anonymized form for statistical purposes and to improve our websites. Please note our Privacy policy.

Le sites Web de Hostpoint (site Web, Control Panel, Centre d'assistance, etc.) utilisent des cookies. Ces cookies servent à collecter des données sur les interactions des visiteurs. En cliquant sur «Accepter», vous consentez à l’utilisation de ces cookies à des fins de publicité, d’analyse du site Web et d’assistance. Certains cookies essentiels sont cependant indispensables au bon fonctionnement de notre sites Web et ne peuvent donc pas être désactivés. Même sans votre consentement, certaines données peuvent être utilisées sous forme anonymisée à des fins statistiques et pour améliorer notre sites Web. Veuillez prendre connaissance de notre Déclaration de protection des données.

Le presenze digitali di Hostpoint (sito web, Pannello di controllo, Support Center, ecc.) utilizzano i cookie. Questi vengono utilizzati per raccogliere dati sulle interazioni dei visitatori. Facendo clic su «Accetta», acconsente all’utilizzo di questi cookie per scopi pubblicitari, di analisi del sito web e di supporto. Alcuni cookie essenziali sono tuttavia indispensabili per il corretto funzionamento di questi siti web e pertanto non possono essere disattivati. Anche senza il Suo consenso, determinati dati potrebbero essere utilizzati in forma anonima per fini statistici e per l’ottimizzazione dei nostri siti web. Si prega di tenere conto della nostra Dichiarazione per la pivacy.

Ablehnen
Decline
Refuser
Rifiuta
Akzeptieren
Accept
Accepter
Accetta