linux:remote_access:openssh
This is an old revision of the document!
OpenSSH
Harden SSH Access
- harden_ssh.sh
#!/bin/bash cp /etc/ssh/sshd_config /etc/ssh/sshd_config.orig grep "PasswordAuthentication yes" /etc/ssh/sshd_config grep "PasswordAuthentication yes" /etc/ssh/sshd_config | sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ss> grep "PermitRootLogin prohibit-password" /etc/ssh/sshd_config grep "PermitRootLogin prohibit-password" /etc/ssh/sshd_config | sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin no/g' /> grep "PermitEmptyPasswords no" /etc/ssh/sshd_config grep "PermitEmptyPasswords no" /etc/ssh/sshd_config | sed -i 's/#PermitEmptyPasswords no/PermitEmptyPasswords no/g' /etc/ssh/sshd_c> grep "KerberosAuthentication no" /etc/ssh/sshd_config grep "KerberosAuthentication no" /etc/ssh/sshd_config | sed -i 's/#KerberosAuthentication no/KerberosAuthentication no/g' /etc/ssh/> grep "GSSAPIAuthentication no" /etc/ssh/sshd_config grep "GSSAPIAuthentication no" /etc/ssh/sshd_config | sed -i 's/#GSSAPIAuthentication no/GSSAPIAuthentication no/g' /etc/ssh/sshd_c> systemctl restart sshd.service
linux/remote_access/openssh.1668267199.txt.gz · Last modified: (external edit)