Created
June 7, 2022 23:12
-
-
Save xholicka/6fee564c49ae4da31b34d23811bead5e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install libpam-google-authenticator | |
google-authenticator | |
lastpass authentictor, google authenticator | |
sudo vim /etc/pam.d/sshd | |
auth required pam_google_authenticator.so | |
sudo nano /etc/ssh/sshd_config | |
ChallengeResponseAuthentication yes | |
sudo systemctl restart sshd | |
sudo nano /etc/pam.d/sshd | |
#@include common-auth | |
sudo nano /etc/ssh/sshd_config | |
AuthenticationMethods publickey,keyboard-interactive | |
sudo systemctl restart sshd | |
sudo apt install fail2ban | |
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local | |
sudo vim /etc/fail2ban/jail.local | |
enabled = true | |
filter = sshd | |
port = ssh | |
banaction = iptables-multiport | |
bantime = 60m | |
maxretry = 3 | |
sudo service fail2ban restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment