Contents

Linux SSH Hardening

SSH with Username and Password

1
ssh <hostname OR IP Address>
1
ssh <user>@<hostname OR IP Address>

SSH with Public and Private Key

Generate Keys

1
ssh-keygen -t rsa

Copy Public Key to the Server

1
ssh-copy-id mark@node01

Check the Copied Public Key on the Server

1
cat /home/mark/.ssh/authorized_keys

Access the Server

1
ssh node01

Hardening SSH Service

1
vi /etc/ssh/sshd_config
1
2
3
4
...
PermitRootLogin no
PasswordAuthentication no
...
1
systemctl restart sshd