staging.inyokaproject.org

Zwei unterschiedliche Authentifikation Methoden 2FA oder TACACS über Gruppen steuern.

Status: Ungelöst | Ubuntu-Version: Server 20.04 (Focal Fossa)
Antworten |

hylpad

Anmeldungsdatum:
25. November 2021

Beiträge: 1

Hallo, ich bin neu hier und leicht Fortgeschrittener Linux Anfänger. Ich wollte mit 2FA Google Authentifikation und TACACS+ experimentieren und die jeweiligen Methoden über Gruppen steuern. Mein Ziel das eine Gruppe sich nur mit TACACS anmelden kann und andere Gruppe nur mit 2FA.

Jede Authentifikation Methode für sich Funktioniert(wenn ich die jeweils andere aus kommentiere). Aber wenn ich es über Gruppen Steuern möchte nicht.

Mein Ansatz

In der /etc/pam.d/sshd auf zwei unterschiedliche sshd zu verweisen

1
2
3
4
5
6
7
auth    [success=1 default=ignore] include      tacacs user notingroup tac-auth
account [success=1 default=ignore] include      tacacs user notingroup tac-auth
session [success=1 default=ignore] include      tacacs user notingroup tac-auth

auth    [success=1 default=ignore] include      2fa-google user ingroup tac-auth
account [success=1 default=ignore] include      2fa-google user ingroup tac-auth
session [success=1 default=ignore] include      2fa-google user ingroup tac-auth

Die jeweiligen Daten enthalten tacacs (sshd)

1
2
3
4
5
6
7
#%PAM-1.0
auth      sufficient /usr/lib/security/pam_tacplus.so debug server=192.168.2.2 timeout=5 secret=testubuntu
account   sufficient /usr/lib/security/pam_tacplus.so debug server=192.168.2.2 timeout=5 secret=testubuntu
session   sufficient /usr/lib/security/pam_tacplus.so debug server=192.168.2.2 timeout=5 secret=testubuntu
auth [success=1 default=ignore] pam_succeed_if.so user notingroup google-auth
auth [success=1 default=ignore] requisite pam_google_authenticator.so forward_pass user notingrou google-auth
auth [success=1 default=ignore] required pam_unix.so use_first_pass user notingroup google-auth

2fa-google (sshd mit den ganzen restlichen normalen informationen)

1
2
auth [success=1 default=ignore] pam_succeed_if.so user notingroup google-auth
auth [success=1 default=ignore] required pam_google_authenticator.so user notingroup google-auth

/etc/ssh/sshd_config

1
2
3
4
5
6
7
8
9
PasswordAuthentication yes
PubkeyAuthentication yes
Match group google-auth
    ChallengeResponseAuthentication yes
    AuthenticationMethods publickey,keyboard-interactive
Match group tac-auth
    ChallengeResponseAuthentication NO
Match group user
    ChallengeResponseAuthentication NO

Es will aber nicht Funktionieren, kann wer helfen?

Antworten |