Created
November 19, 2015 12:29
-
-
Save zetrider/28f1d463c6bd9af1c0e6 to your computer and use it in GitHub Desktop.
Авторизация SSH по RSA ключу - TimeWeb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user - имя пользователя | |
server.timeweb.ru - сервер | |
1. На машине ssh-keygen -t rsa | |
2. Копируем, можно по FTP или одной из команд | |
2.1. ssh-copy-id -i ~/.ssh/id_rsa user@server.timeweb.ru | |
2.2. scp ~/.ssh/id_rsa.pub user@server.timeweb.ru:~ | |
3. На сервере | |
[ -d ~/.ssh ] || (mkdir ~/.ssh; chmod 711 ~/.ssh) # создание директории и изменение прав | |
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys # добавление открытого ключа | |
chmod 600 ~/.ssh/authorized_keys # установка корректных прав | |
rm ~/id_rsa.pub # удаление ненужного ключа |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment