Hallo Netcup Community,
ich versuche verzweifelt eine Multi-Faktor-Authentifizierung auf meinem Root Server auf dem Debian 9 läuft zu installieren/integrieren.
Ich habe schon in Google sämtliche Themen darüber durchstöbert, bis ich an den Punkt der Verwirrung angekommen bin, da in jedem zweiten Thema entweder die hälfte weggelassen oder ich sage mal "Sinnentleert" dahin geschrieben wurde.
Was ich bis jetzt unternommen habe:
Installationsschritte:
- apt-get install libpam-google-authenticator. (Als Root)
- den Befehl: google-authenticator (als User) eingegeben und die darauffolgenden Fragen beantwortet.
In der Datei / etc / pam.d / sshd folgendes unternommen:
# Standard Un*x authentication.
#@include common-auth
# Google Authentication
auth required pam_google_authenticator.so
In der Datei / etc / ssh / sshd_config folgendes unternommen:
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication yes
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
AuthenticationMethods publickey,password publickey,keyboard-interactive
Was auch funktioniert, wenn ich mich erneut per SSH verbinde werde ich nach meinem Schlüssel (Public-Key) gefragt den ich eingeben soll (was auch vollständig funktioniert) und danach werde ich nach dem Verification code gefragt der auch funktioniert bei der richtigen Eingabe, wenn ich aber eine falsche Eingabe tätige schmeißt er mich raus (soll ja auch so sein) nur dann kann ich mich nicht mehr per SSH, FTP oder sonstiges verbinden, und jetzt ist meine Frage woran das liegt bzw. was das sein könnte.
Ich hoffe mir kann hier geholfen werden, da ich diesbezüglich nicht mehr weiter weiß.
Mit freundlichen Grüßen
Kmdt.Brandt