ssh: key autorization

Are you tired to enter a password when you log on your server? Or perhaps you're being attacked bruteforce and sshguard and pam_geoip put you broke? Make the authentication key and disable password authentication.

1. On local pc: ssh-keygen -t rsa

2. ssh-copy-id -i ~/.ssh/id_rsa.pub example.com // this comman create ~/.ssh/autorized_keys on remote server

3. On local pc: edit /etc/ssh/ssh_config:

IdentityFile ~/.ssh/identity
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/id_dsa

4. On remote pc: edit /etc/ssh/sshd_config

RSAAuthentication yes
PubkeyAuthentication yes

5. On remote pc:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

6. from local pc:

ssh example.com // you must login without password request