diff options
Diffstat (limited to 'content/blog/2022-03-26-ssh-mfa.md')
-rw-r--r-- | content/blog/2022-03-26-ssh-mfa.md | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/content/blog/2022-03-26-ssh-mfa.md b/content/blog/2022-03-26-ssh-mfa.md index 8b444f4..658fd14 100644 --- a/content/blog/2022-03-26-ssh-mfa.md +++ b/content/blog/2022-03-26-ssh-mfa.md @@ -11,10 +11,10 @@ If you are a sysadmin of a server anywhere (that includes at home!), you may want an added layer of protection against intruders. This is not a replacement for other security measures, such as: -- Disable root SSH -- Disable SSH password authentication -- Allow only certain users to login via SSH -- Allow SSH only from certain IPs +- Disable root SSH +- Disable SSH password authentication +- Allow only certain users to login via SSH +- Allow SSH only from certain IPs However, MFA can be added as an additional security measure to ensure that your server is protected. This is especially important if you need to allow password @@ -52,7 +52,7 @@ If you are not sure how to answer, read the prompts carefully and think about having to how each situation would affect your normal login attempts. If you are still not sure, use my default responses below. -``` txt +```txt OUTPUT Do you want authentication tokens to be time-based (y/n) y @@ -62,13 +62,13 @@ At this point, use an authenticator app somewhere one of your devices to scan the QR code. Any future login attempts after our upcoming configuration changes will require that TOTP. -``` txt +```txt OUTPUT Do you want me to update your "/home/user/.google_authenticator" file? (y/n) y ``` -``` txt +```txt OUTPUT Do you want to disallow multiple uses of the same authentication @@ -76,7 +76,7 @@ token? This restricts you to one login about every 30s, but it increases your chances to notice or even prevent man-in-the-middle attacks (y/n) y ``` -``` txt +```txt OUTPUT By default, a new token is generated every 30 seconds by the mobile app. @@ -91,7 +91,7 @@ between client and server. Do you want to do so? (y/n) n ``` -``` txt +```txt OUTPUT If the computer that you are logging into isn't hardened against brute-force @@ -112,7 +112,7 @@ google-authenticator -t -d -f -r 3 -R 30 -w 3 The options referenced above are as follows: -``` txt +```txt google-authenticator [<options>] -h, --help Print this message -c, --counter-based Set up counter-based (HOTP) verification @@ -152,7 +152,7 @@ sudo nano /etc/pam.d/sshd You need to do two things in this file. First, add the following lines to the bottom of the file: -``` config +```config auth required pam_google_authenticator.so nullok auth required pam_permit.so ``` @@ -166,7 +166,7 @@ following three authentication factors: 2. Password 3. T/OTP code -``` config +```config #@include common-auth ``` @@ -181,7 +181,7 @@ sudo nano /etc/ssh/sshd_config You'll need to change `ChallengeResponseAuthentication` to yes and add the `AuthenticationMethods` line to the bottom of the file. -``` config +```config ChallengeResponseAuthentication yes AuthenticationMethods publickey,password publickey,keyboard-interactive ``` |