Two-factor authentication: Unterschied zwischen den Versionen

Aus xinux.net
Zur Navigation springen Zur Suche springen
Zeile 42: Zeile 42:
 
  auth required pam_google_authenticator.so
 
  auth required pam_google_authenticator.so
 
*vi /etc/ssh/sshd_config
 
*vi /etc/ssh/sshd_config
change ChallengeResponseAuthentication '''no'''  
+
change
 +
 
 +
ChallengeResponseAuthentication '''no'''  
  
 
to
 
to
  
ChallengeResponseAuthentication '''yes'''
+
ChallengeResponseAuthentication '''yes'''
 
*systemctl restart sshd.service
 
*systemctl restart sshd.service

Version vom 5. Februar 2019, 10:34 Uhr

Install Google PAM

  • apt-get update
  • apt-get install libpam-google-authenticator

Generate TOTP for a user

  • google-authenticator
Do you want authentication tokens to be time-based (y/n) Y

QR-Code scannen

Do you want me to update your "home/user/google_authenticator" file (y/n) Y
Do you want to disallow multiple uses of the same 
authentication 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
In order to compensate for possible time-skew between the client and the server,
we allow an extra token before and after the current time. This allows for a
time skew of up to By default, a new token is generated every 30 seconds by the mobile app.
30 seconds between authentication server and client. If you
experience problems with poor time synchronization, you can increase the window
from its default size of 3 permitted codes (one previous code, the current
code, the next code) to 17 permitted codes (the 8 previous codes, the current
code, and the 8 next codes). This will permit for a time skew of up to 4 minutes
between client and server.
Do you want to do so? (y/n) Y
If the computer that you are logging into isn't hardened against brute-force
login attempts, you can enable rate-limiting for the authentication module.
By default, this limits attackers to no more than 3 login attempts every 30s.
Do you want to enable rate-limiting? (y/n) Y

Enable PAM On SSH

  • vi /etc/pam.d/sshd

add

auth required pam_google_authenticator.so
  • vi /etc/ssh/sshd_config

change

ChallengeResponseAuthentication no

to

ChallengeResponseAuthentication yes

  • systemctl restart sshd.service