Skip to content

Instantly share code, notes, and snippets.

@d1i1m1o1n
Forked from zetrider/TimeWeb - SSH RSA Key
Created November 9, 2016 06:53
Show Gist options
  • Save d1i1m1o1n/6f056f13c83cc640f2323073404889aa to your computer and use it in GitHub Desktop.
Save d1i1m1o1n/6f056f13c83cc640f2323073404889aa to your computer and use it in GitHub Desktop.
Авторизация SSH по RSA ключу - TimeWeb
user - имя пользователя
server.timeweb.ru - сервер
1. На машине ssh-keygen -t rsa
2. Копируем, можно по FTP или одной из команд
2.1. ssh-copy-id -i ~/.ssh/id_rsa [email protected]
2.2. scp ~/.ssh/id_rsa.pub [email protected]:~
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