Авторизация по SSH ключу

October 2, 2015 16:12    ssh


ssh-keygen -t rsa

scp -P 22 ~/.ssh/id_rsa.pub  user@remote-server.com:~

ssh user@remote-server.com
[ -d ~/.ssh ] || (mkdir ~/.ssh; chmod 711 ~/.ssh)
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
rm ~/id_rsa.pub