Connection via SSH/RDP

You need to connect to the server via SSH (for servers based on Linux) or via RDP (for servers based on Windows) to manage it remotely (for example, from your local computer).

Connection via SSH

SSH protocol is used to connect to the servers running Linux. SSH protocol allows you to securely manage the server over the network.

You can connect to the server: - using login and password from the Control panel – in this case, each time you connect to the server, you need to enter your password; - using a pair of generated SSH keys – in this case, you do not need to enter your password, the user is identified at the first connection. A key pair is used: the public key is hosted on the server, and the private key is stored on the user’s PC. Please note that you can connect to the server via SSH only from the computer where the private SSH key is stored.

The data specified on the Operating system tab of the server page in the Control panel are used to connect to the server:

  • server’s public IP address (IP field);
  • root login and password for accessing the system (Username and Password fields).

Connection via SSH on Linux / macOS

To connect to the server via SSH, run the following command in the terminal:

ssh root@<server IP>

Where server IP is server’s public IP address.

The system will request a password from the server, you need to enter it. If you have previously created a key pair, then you do not need to specify the password to connect to the server.

Connection via SSH on Windows

In Windows 10, the connection is the same as in Linux and macOS, but through the command line (cmd.exe).

In earlier versions of Windows, the server is connected using PuTTY:

  1. Launch PuTTY.
  2. Go to the Session tab. Enter the public IP address of the server in the Host Name field, enter 22 in the Port field.
  3. Specify the SSH connection type in the Connection type field.
  4. If you connect using the previously generated keys, go to the SSHAuth tab, click Browse and select the file with a private key.
  5. Click Open to connect.
  6. Confirm the connection. In the opened console, specify the root login and password to log into the server. If you have previously created a key pair, then you do not need to specify a password to connect to the server.

Creating a Key Pair on Linux / macOS

To create a key pair:

  1. Open the terminal and run the command:

    ssh-keygen -t rsa
  2. The following dialog will be displayed on the console:

    Enter file in which to save the key (/home/user/.ssh/id_rsa):

    Specify the name of the file where the keys will be saved, or use the default name and path /.ssh/id_rsa.

  3. The system will offer you to enter a passphrase for advanced protection of the SSH connection:

    Enter passphrase (empty for no passphrase):
    Enter same passphrase again: 

    You can skip this step.

  4. After that, a private (~/.ssh/id_rsa) and public (~/.ssh/id_rsa.pub) key will be created. The following message will be displayed on the console:

    Your identification has been saved in /home/user/.ssh/id_rsa.
    Your public key has been saved in /home/user/.ssh/id_rsa.pub.
    The key fingerprint is:
    476:b2:a8:7f:08:b4:c0:af:81:25:7e:21:48:01:0e:98 user@localhost
     
    The key's randomart image is:
     
    +---[RSA 2048]----+
    |      ..o   o    |
    |      .. * * = . |
    |     .  o O o B .|
    |    . .  + = = o |
    |     oo S o = . .|
    |    .. B . = . . |
    |   .  B   o =  ..|
    |  . .o.o.. o .. .|
    |   .oooE    o.   |
    +----[SHA256]-----+
  5. To display the public key on the console, run the command:

    cat ~/.ssh/id_rsa.pub

    Please note that ~/.ssh/id_rsa.pub is the path to the file where the public key is stored. If you changed the path in step 2, specify it.

  6. Add the public key in the Selectel Сontrol panel. Click Change OS configuration on the Operating system tab of the server page and enter the key in the SSH public field.

After creating the keys, you can connect to the server without a password.

Creating a Key Pair on Windows

In Windows 10, you can create a key pair in the same way as in Linux and macOS, but through the command line (cmd.exe).

In earlier versions of Windows, the keys are generated using PuTTY:

  1. Install PuTTY and launch the PuTTYgen app.
  2. From the Type of key to generate menu, select the RSA key type and click Generate. Move the cursor around the screen until the keys are generated.
  3. After the key pair has been created, the public key will be displayed. Click Save public key and save it in a text file, for example, in a new file id_rsa.pub.
  4. Enter a passphrase for additional security in the Key passphrase field. You can skip this step.
  5. Click Save private key to save the private key.
  6. Add the public key in the Selectel Сontrol panel. Click Change OS configuration on the Operating system tab of the server page and enter the key in the SSH public field.

After creating the keys, you can connect to the server without a password.

Connection via RDP

RDP stands for Remote Desktop Protocol. RDP is used to remotely connect to servers running Microsoft Windows. The remote desktop connection feature is available in Windows by default. You do not need to create specific keys.

The following data is used to connect to the server:

  • public server IP address;
  • login and password for accessing the system.

Connection via RDP on Windows

To connect to a Windows server via RDP:

  1. In the search box (Start menu), type Connect to remote desktop.
  2. Enter the public IP address of the server in the Computer field in the opened window.
  3. Click Connect.
  4. Enter your login and password.
  5. Press OK.

Connection via RDP on Linux

To connect via RDP through the terminal, run the command:

rdesktop <server IP> -u <user> -p <password>

Where:

  • server IP is the public IP address of your server;
  • user and password are the login and password.

Connection via RDP on macOS

To connect to a server:

  1. Install and run Microsoft Remote Desktop.
  2. Click +. In the PC name field, enter the public IP address, in the Username and Password fields, enter your username and password.
  3. Click Save and save your changes.
  4. To connect to a remote server, double-click on the created connection in the list.