servers:secure_shell
Table of Contents
Information
- OpenSSH server notes
- See OpenSSH Client notes for clients
Config Files
Main
sudo -e '/etc/ssh/sshd_config'
Custom
- Check
sshd_config
to make suresshd_config.d
is included
/etc/ssh/sshd_config.d
Force Public Key Authentication
- Be sure to generate/restore keys and to copy to server before disabling passwords
- See SSH Client notes
- Tested on Ubuntu 20.04
echo 'PasswordAuthentication no' | sudo tee '/etc/ssh/sshd_config.d/custom-pubkey-only.conf' > '/dev/null' && cat '/etc/ssh/sshd_config.d/custom-pubkey-only.conf'
sudo -e '/etc/ssh/sshd_config.d/custom-pubkey-only.conf'
Secure Authorized Keys
chmod '400' ~/'.ssh/authorized_keys'
Disable Root Login
echo 'PermitRootLogin no' | sudo tee '/etc/ssh/sshd_config.d/custom-root-login-disable.conf' > '/dev/null' && cat '/etc/ssh/sshd_config.d/custom-root-login-disable.conf'
sudo -e '/etc/ssh/sshd_config.d/custom-root-login-disable.conf'
/var/www/wiki/data/pages/servers/secure_shell.txt · Last modified: 2020/06/12 03:12 by Sean Rhone