How To Configure SSH Key-Based Authentication On A Linux Server - DigitalOcean
How To Configure SSH Key-Based Authentication On A Linux Server - DigitalOcean
fail2ban
1 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
~/.ssh/authorized_keys
ssh-keygen
ssh-keygen
~/.ssh
id_rsa id_rsa.pub
2 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
3 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
4 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNqqi1mHLnryb1FdbePrSZQdmXRZxGZbo0gTfglysq6KMNUNY2
5 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
~/.ssh
/authorized_keys
ssh-copy-id
ssh-copy-id
ssh-copy-id username@remote_host
6 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
id_rsa.pub
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now i
username@111.111.11.111's password:
~/.ssh/id_rsa.pub ~/.ssh
authorized_keys
id_rsa.pub
ssh-copy-id
~/.ssh
authorized_keys
>>
7 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
cat ~/.ssh/id_rsa.pub | ssh username@remote_host "mkdir -p ~/.ssh && cat >> ~/.ssh/autho
username@111.111.11.111's password:
id_rsa.pub
authorized_keys
id_rsa.pub ~/.ssh/authorized_keys
id_rsa.pub
cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCqql6MzstZYh1TmWWv11q5O3pISj2ZFl9HgH1JLknLLx44+tXf
8 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
~/.ssh
mkdir -p ~/.ssh
authorized_keys
id_rsa.pub authorized_keys
ssh username@remote_host
9 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
sudo
sudo
PasswordAuthentication
PasswordAuthentication no
sshd
10 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
11 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
ssh -i
12 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
13 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
14 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
ssh-keygen id_rsa
ssh-copy-id
15 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
16 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
17 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
testClient testServer
testClient
ssh-keygen
~/.ssh/authorized_keys
ssh-copy-id
testServer ~/.ssh
/authorized_keys ssh-copy-id testServer@Server-
B_IP_address testServer
ssh-copy-id
ssh ssh testServer@Server-B_IP_address
18 of 19 3/5/2018, 5:21 PM
How To Configure SSH Key-Based Authentication on a Linux Server | D... https://www.digitalocean.com/community/tutorials/how-to-configure-ssh...
19 of 19 3/5/2018, 5:21 PM