Monday, December 21, 2015

How To Set Up SSH With Public-Key Authentication On Debian

https://www.howtoforge.com/set-up-ssh-with-public-key-authentication-debian-etch

Summary:
server> apt-get install ssh
client> mkdir ~/.ssh
client> chmod 700 ~/.ssh
client> cd ~/.ssh
client> ssh-keygen -t rsa -C "A comment"
client> scp -p id_rsa.pub remoteuser@remotehost:/tmp
server>ssh remoteuser@remotehost
server>mkdir ~/.ssh
server>chmod 700 ~/.ssh
server>cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys
server>chmod 600 ~/.ssh/authorized_keys
server>mv /tmp/id_rsa.pub ~/.ssh
server>logout
client> rm id_rsa.pub
client> ssh remoteuser@remotehost