Restricting SSH access¶
Default configuration file¶
Creating custom config file¶
AllowUsers user1 admin1
AllowGroups group1 group1 admin
PermitRootLogin no
PasswordAuthentication no
Allowing hosts¶
Allow hosts on network using firewall¶
Enabling certificate based SSH authentication¶
:::info ssh-keygen not to be run as root as this will add key to root user :::
Creating certifiacte¶
Adding to /etc/ssh/sshd_conf.d/hardened.conf¶
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
HostKeyAlgorithm ssh-ed25519,ssh-ed25519-cert,...
:::info The last line can be found in `cat ~/key-algorithms.txt :::