Hacker
Professional
- Messages
- 1,044
- Reaction score
- 834
- Points
- 113
To manage the server remotely, for example from your local computer, you need to connect to it via SSH (for servers based on Linux OS) or RDP (OS Windows).
Connect to server via SSH
The SSH protocol is used to connect to servers running Linux. It allows you to securely manage your server over the network.
You can connect to the server:
To connect to the server, the data specified in the control panel on the Operating system tab on the server page are used:
SSH connection from Linux / macOS
To connect to the server via SSH, enter the command in the terminal:
Where server IPis the public IP address of the server.
Next, the system will ask for a password from the server, enter it. If you have previously created a key pair, then you do not need to specify a password to connect to the server.
Connect via SSH from 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 connection to the server is made using PuTTY:
Generating a key pair on Linux / macOS
To create a key pair:
Generating a key pair in 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).
Earlier versions of Windows use PuTTY to generate keys:
Connecting to the server via RDP
Remote Desktop Protocol (RDP) is used to connect remotely to servers running Microsoft Windows. Remote Desktop Connection is available by default in Windows. You do not need to create special keys.
To connect to the server, the data specified on the Operating system tab on the server page are used:
RDP connection from Windows
To connect to a Windows server via RDP:
RDP connection from Linux
To connect via RDP through the terminal, enter the command:
Where:
RDP connection from macOS
To connect to the server:
Connect to server via SSH
The SSH protocol is used to connect to servers running Linux. It allows you to securely manage your server over the network.
You can connect to the server:
- by login and password from the control panel - in this case, each time you connect to the server, you need to enter the password;
- by a pair of generated SSH keys - with such a connection, you do not need to enter a password, the user is identified at the first connection. A key pair is used: the public key is stored on the server, and the private key is stored on the user's computer.
Note: you can connect to the server via SSH only from the computer where the private SSH key is stored.
To connect to the server, the data specified in the control panel on the Operating system tab on the server page are used:
- public IP address of the server (IP field);
- login rootand password to access the system (Username and Password fields).
SSH connection from Linux / macOS
To connect to the server via SSH, enter the command in the terminal:
Code:
ssh root@<server IP>
Where server IPis the public IP address of the server.
Next, the system will ask for a password from the server, enter it. If you have previously created a key pair, then you do not need to specify a password to connect to the server.
Connect via SSH from 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 connection to the server is made using PuTTY:
- Start PuTTY.
- Go to the Session tab. Enter the server's public IP address in the Host Name field, and 22 in the Port field.
- Specify the SSH connection type in the Connection type field.
- If you are connecting using previously generated keys, go to the SSH - Auth tab, click Browse and select the file with the private key.
- Click Open to connect.
- Confirm the connection. In the console that opens, specify the username rootand 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.
Generating a key pair on Linux / macOS
To create a key pair:
- Open a terminal and run the command:
Code:ssh-keygen -t rsa
- The following dialog will appear in 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. - The system will prompt you to enter a passphrase for additional protection:
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
You can skip this step. - A private key (~/.ssh/id_rsa) and a public key (~/.ssh/id_rsa.pub) will be generated. The following message will appear in 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:
Code: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]-----+ - To display the public key to the console, run the command:
Code:cat ~/.ssh/id_rsa.pub
- Add the public key in the Selectel control panel - on the Operating system tab on the server page, click the Change server configuration button and enter the key in the SSH field.
Generating a key pair in 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).
Earlier versions of Windows use PuTTY to generate keys:
- Install PuTTY and launch the PuTTYgen application.
- 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.
- After the key pair has been generated, the public key will be displayed. Click Save public key and save it in a text file, for example in a new file with the name id_rsa.pub.
- In the Key passphrase field, enter a passphrase for additional security. You can skip this step.
- Click Save private key to save the private key.
- Add the public key in the Selectel control panel - on the Operating system tab on the server page, click the Change server configuration button and enter the key in the SSH field .
Connecting to the server via RDP
Remote Desktop Protocol (RDP) is used to connect remotely to servers running Microsoft Windows. Remote Desktop Connection is available by default in Windows. You do not need to create special keys.
To connect to the server, the data specified on the Operating system tab on the server page are used:
- public IP address of the server (IP field);
- login and password to access the system (Username and Password fields).
RDP connection from Windows
To connect to a Windows server via RDP:
- In the search box (Start menu), find and select Remote Desktop Connection.
- In the window that opens, in the Computer field, enter the public IP address of the server.
- Click the Connect button.
- Enter login and password.
- Click OK.
RDP connection from Linux
To connect via RDP through the terminal, enter the command:
Code:
rdesktop <server IP> -u <user> -p <password>
Where:
- server IP - public IP address of the server;
- userand password- login and password.
RDP connection from macOS
To connect to the server:
- Install and run Microsoft Remote Desktop.
- Click +. In the PC name field, enter the public IP address, in the Username and Password fields, enter your username and password.
- Click Save and save your changes.
- To connect to a remote server, double-click on the created connection in the list.