title: SSH Protocol
created at: Sat Jul 20 2024 22:07:46 GMT+0000 (Coordinated Universal Time)
updated at: Mon Feb 10 2025 16:44:57 GMT+0000 (Coordinated Universal Time)
---
# SSH Protocol
SSH is a network protocol for connecting remotely to a server. SSH uses traffic encryption algorithms, so an SSH connection is secure.
The connection is made under a remote server account. A password or SSH keys are used for authentication.
If the platform administrator has enabled notification of users about VM creation, you will receive an email with connection settings. The message is sent to the e-mail specified during registration in the platform. If you do not receive such a message, ask the platform administrator for connection settings.
The software for SSH consists of two parts:
* server — installed on a remote server;
* client — installed on the user's computer.
# Connecting to a VM via SSH

## Installing client software

For the Unix OS family (Ubuntu, Debian, AlmaLinux, macOS, etc.), no additional software is required.
For Windows 10 or higher, install the \*\*OpenSSH client \*\*component.
## Connecting with a login and password

1. Open the terminal window or the console.
2. Enter the command:
```bash
ssh root@host
```
```
Comments to the command
host — IP address or domain name of the VM
```
1. Enter the root password of the VM.
## Connecting using SSH keys

SSH key consists of a pair of keys — the private key and the public key. The private key is the secret information that is kept by the user. The public key must be stored on the server to be accessed via SSH.
1. Generate the key:
1. Open the terminal window or the console.
2. Enter the command:
```bash
ssh-keygen
```
```
1. Specify the name and path to the file for SSH keys. By default, in Windows, the SSH key is stored in the **C:\Users\<username>\.ssh\** directory, and in Unix family OS — in **/home/<username>/.ssh/**. By default, the private key is saved to the **id_rsa** file, and the public key — to **id_rsa.pub**.
```
1. Copy the key to the VM:
* to add the key in new VMs automatically, specify it in the client area;
* to provide the key to an existing VM, copy its contents to the \*\*/root/.ssh/authorized\_keys \*\*file on the VM. On Unix systems, you can use the command to do this:
```bash
ssh-copy-id -i <path_to_key> root@host
```
```
Comments to the command
<path_to_key> — path to the file with the opened SSH key
host — IP address or domain name of the VM
```
1. Connect to the VM:
1. Open the terminal window or the console.
2. Enter the command:
```bash
ssh root@host
```
```
Comments to the command
host — IP address or domain name of the VM
```
## Copying files

You can copy files from a workstation to a VM and back using the *scp* utility. To do this:
1. Open the terminal window or the console.
2. Enter the command:\
Copy a file from workstation to VM
```bash
scp <path_to_local_file> <user>@<host>:<path_to_remote_file>
```
```
Copy a file from VM to workstation
```
```bash
scp <user>@<host>:<path_to_remote_file> <path_to_local_file>
```
```
Comments to the commands
<path_to_local_file> — path to the file on the workstation
<user> — account with superuser permissions
<host> — IP address or domain name of the VM
<path_to_remote_file> — path to the file on the VM
```
Example command:
```bash
scp my_local_file.txt
[email protected]:/root/my_dir/my_remote_file.txt
```