1. Home
  2. Technical
  3. SSH / Shell
  4. Establishing an SSH connection
  1. Home
  2. Technical
  3. Establishing an SSH connection

Establishing an SSH connection

Windows 11

SSH is installed by default on Windows 11. In order to establish an SSH connection, you must first generate private/public key pair, the public key must be added to the My Zone control panel. The private key will remain on your computer, which should be protected so that it does not fall into the hands of a third party.

Start Windows Powershell. To do this, press the Windows key + R. In the window that opens, type powershell and press OK, or open the Start menu and type powershell.

Open powershell

In the terminal window that opens, type ssh-keygen.exe
You will then be prompted for the private key filename (you can leave it as default and just press Enter) and the password twice. The password can be left blank, but it is still recommended to set a password for security reasons.

Generating SSH key pair

Next, we copy the public key to the buffer. The public key is located in the .ssh directory in a file named id_rsa.pub. You can see the contents of the file by typing cat .ssh\id_rsa.pub in the console. Use the mouse to select the contents of the private key (starts with ssh-rsa and ends with username@computername). To copy it to the buffer, press Enter or right-click on the selected text.

Coping SSH key

Now enter the My Zone control panel and open the desired web-hosting management.
From the menu on the left, click on the SSH.

In the Access from option, you can specify whether the SSH access of the corresponding user is limited to an IP address. If desired, add IP addresses + Add new whitelisted IP allowed button. If you do not want to add an IP address restriction, you can select Access from Everywhere.

The IP address can also be limited to a subnet. This is useful, for example, when adding IPv6 IP addresses.

Then click Add new public key.

In the “Contents” box that opens, paste the contents of the id_rsa.pub file from the buffer. After entering the key, the comment field will automatically fill in, which can be edited if desired. The comment can later be used to identify who the key belongs to, so that the key can be removed if necessary.

Add new public key

Click Save changes. The key will arrive on the server within 10 minutes.

After 10 minutes, you can try to connect via SSH.

The SSH username is in the form of virt + number. For example virt33390. The login information can also be seen on the SSH access page.
Now type in the Powershell window: ssh username@servername. The first time you connect, you will be asked if you trust the server’s fingerprint. Type yes and press Enter. You should now be logged in.

SSH

Key pair generation and insertion only needs to be done once during the initial setup.

Putty

Creating an SSH Key Pair Using PuTTYgen

To establish an SSH connection, you must first generate a key pair, the public part of which must be added to the My Zone control panel. The private key remains on your computer, which should be protected to prevent it from falling into the hands of third parties.
It is possible to add keys of type EdDSA, ECDSA or RSA through the My Zone control panel. In this guide, a key pair of type EdDSA (also known as Ed25519) will be created.

Run the PuTTY Key Generator PuTTYgen, select EdDSA as the key type and click on the Generate button.

PuTTYgen EdDSA

It is advisable to enter a comment in the Key comment text box to identify the key later, e.g. the name of the virtual user or the hostname.
It is also recommended to add a password for the security of the private key in the text box Key passphrase and repeat it in the text box Confirm passphrase.

PuTTYgen public ja private võtmed

Save the public and private key to your computer by clicking Save public key and Save private key.

By default, PuTTY Key Generator saves the public key in PEM format.
The public key added via the My Zone control panel must be in SSH1 format.
A public key in SSH1 format can be copied from the top text box of PuTTY Key Generator. In the upper text box, copy all the text whose content starts with “ssh-ed25519”.

PuTTYgen SSH1 public võti

Using a text editor (e.g. Notepad), open the newly saved public message file, delete its contents and paste the copied SSH1 format public message contents into the file and save the change.

Ed25519 SSH1 avalik võti

If necessary, SSH1 and SSH2 format public key can be generated from an existing private key. To do this, you need to load the private key in the PuTTY Key Generator, after which you can retrieve the public key.

Upload the public key via the My Zone control panel, following the Windows 11 instructions above.

Establishing an SSH connection with PuTTY

Run PuTTY and save the session data so that you can quickly establish an SSH connection later.
Enter the hostname or IP address of the server and name the session in the Saved Sessions text box.
The IP address of the server can be found in the My Zone control panel on the Webhosting page by selecting WebhostingSystem InformationIP-address. It is recommended to use an IP address – this will avoid situations where a host or domain name does not resolve to IP due to DNS problems or domain expiration.

PuTTY

In the category tree on the left, select ConnectionData and enter the name of the virtual user in the Auto-login username text box.

PuTTY

From the category tree on the left, select ConnectionSSHAuth and select the Private key file for authentication by clicking the Browse button.

PuTTY

If Pageant is used in conjunction with PuTTY to load a private key, check Attempt authentication using Pageant instead of selecting a private key.

Select Session from the category tree on the left and save your session data by clicking Save.

PuTTY

Now the necessary data to establish an SSH connection has been saved and you can establish an SSH connection to the server by clicking the Open button.

Read more:
Detecting slow PHP requests

Updated on 19. Apr 2024

Was this article helpful?

Related Articles