SSH Keys

SSH keys are a pair of private and public keys. Private key - secret information stored by the user. The public key must be stored on a server that will be accessed via SSH.

Generating SSH Keys
On Linux systems, keys are generated as follows:

ssh-keygen [options]
The main options are -t to specify the encryption algorithm and -b to specify the key length:

ssh-keygen -t rsa -b 4096
ssh-keygen -t dsa
ssh-keygen -t ecdsa -b 521
ssh-keygen -t ed25519
When generating keys, specify the path to the file where the private key will be written. The public key will be written to a file named <path to file> .pub.

Copying the public key
The user's public key must be copied to the server, which will be accessed via the SSH protocol, to the ~ / .ssh / authorized_keys file:

ssh-copy-id -i ~ / .ssh / id_rsa.pub user @ host

user - the user account of the remote server.

host - the IP address of the remote server.

~ - the directory of the home folder of the remote server user.

When connecting, you need to enter the password of the remote server user.

  • 170 Пользователей нашли это полезным
Помог ли вам данный ответ?

Статьи по Теме

Резервные копии

Резервная копия — это образ диска виртуальной машины (ВМ), который используется для её...

Режим восстановления

Режим восстановления виртуальной машины (ВМ) — запуск ВМ с LiveCD-образом операционной системы...

Что такое VNC и как его использовать. Как войти в виртуальную машину на Android

VNC — система удалённого доступа к рабочему столу компьютера. Позволяет передавать нажатия клавиш...

Как создать скрипт

Скрипты позволяют автоматически настраивать виртуальные машины: устанавливать программное...

Подключение VPS через SSH

Для подключения нам нужны данные, если вы не знаете где их взять, не переживайте, всё находиться...