linux:remote_access:openssh
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:remote_access:openssh [2022/11/12 16:33] – gsys | linux:remote_access:openssh [2024/03/12 16:33] (current) – [Regenerate Host Keys] gsys | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| <file bash harden_ssh.sh> | <file bash harden_ssh.sh> | ||
| #!/bin/bash | #!/bin/bash | ||
| + | |||
| cp / | cp / | ||
| - | grep " | ||
| - | grep " | ||
| - | grep "PermitRootLogin prohibit-password" / | + | grep "PasswordAuthentication" / |
| - | grep "PermitRootLogin prohibit-password" / | + | grep "PasswordAuthentication yes" / |
| - | grep "PermitEmptyPasswords no" / | + | grep "PermitRootLogin" / |
| - | grep "PermitEmptyPasswords no" / | + | grep "PermitRootLogin yes" / |
| - | grep "KerberosAuthentication no" / | + | grep "PermitEmptyPasswords" / |
| - | grep "KerberosAuthentication | + | grep "PermitEmptyPasswords |
| - | grep "GSSAPIAuthentication | + | grep "KerberosAuthentication" |
| - | grep " | + | grep " |
| + | |||
| + | grep " | ||
| + | grep " | ||
| + | |||
| + | grep " | ||
| + | grep " | ||
| systemctl restart sshd.service | systemctl restart sshd.service | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ===== Regenerate Host Keys ===== | ||
| + | |||
| + | 1. Regeneate Host Keys | ||
| + | < | ||
| + | sudo rm -v / | ||
| + | sudo dpkg-reconfigure openssh-server | ||
| + | sudo systemctl restart ssh # restart service | ||
| + | </ | ||
| + | |||
| + | 2. Delete old Public Keys from clients known_hosts files | ||
linux/remote_access/openssh.1668267199.txt.gz · Last modified: (external edit)