Beiträge von Kmdt.Brandt

    Hallo netcup-Community,

    ich habe seit ein paar Tagen wieder einen gemieteten Rootserver hier bei Netcup der unter Debian 10 läuft, jedoch habe ich ein kleines Problem, welches ich bei den vorherigen Distributionen (Debian 9 & Debian 10 ) noch nie hatte bzw. das noch nie so vorgekommen ist.

    Mein Problem besteht darin, dass sich der befehl dpkg-reconfigure apticron nicht ausführen lässt, normalerweise sollte ein Fenster erscheinen indem ich eine E-Mail Adresse eingeben muss aber nach absenden des Befehls passiert nichts und ich habe keine Ahnung wieso.

    Ich hoffe mir kann hier weitergeholfen werden.

    Mit freundlichen Grüßen

    Brandt

    //Edit:

    Habe es bis jetzt soweit, dass man sich mit den User GameserverRoot und VoiceserverRoot zwar per SSH einloggen kann, jedoch werde ich nach der Passphrase gefragt und anschließend nach dem Passwort, allerdings gibt es mit der Passworteingabe ein Problem, egal was ich eingebe, ich werde mit dem Server verbunden.

    Hier nochmal meine Konfigurationsdateien.


    /etc/pam.d/sshd

    Spoiler anzeigen

    # PAM configuration for the Secure Shell service

    # Standard Un*x authentication.

    #@include common-auth

    # Disallow non-root logins when /etc/nologin exists.

    account required pam_nologin.so

    # Uncomment and edit /etc/security/access.conf if you need to set complex

    # access limits that are hard to express in sshd_config.

    # account required pam_access.so

    # Standard Un*x authorization.

    @include common-account

    # SELinux needs to be the first session rule. This ensures that any

    # lingering context has been cleared. Without this it is possible that a

    # module could execute code in the wrong domain.

    session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close

    # Set the loginuid process attribute.

    session required pam_loginuid.so

    # Create a new session keyring.

    session optional pam_keyinit.so force revoke

    # Standard Un*x session setup and teardown.

    @include common-session

    # Print the message of the day upon successful login.

    # This includes a dynamically generated part from /run/motd.dynamic

    # and a static (admin-editable) part from /etc/motd.

    session optional pam_motd.so motd=/run/motd.dynamic

    session optional pam_motd.so noupdate

    # Print the status of the user's mailbox upon successful login.

    session optional pam_mail.so standard noenv # [1]

    # Set up user limits from /etc/security/limits.conf.

    session required pam_limits.so

    # Read environment variables from /etc/environment and

    # /etc/security/pam_env.conf.

    session required pam_env.so # [1]

    # In Debian 4.0 (etch), locale-related environment variables were moved to

    # /etc/default/locale, so read that as well.

    session required pam_env.so user_readenv=1 envfile=/etc/default/locale

    # SELinux needs to intervene at login time to ensure that the process starts

    # in the proper default security context. Only sessions which are intended

    # to run in the user's context should be run after this.

    session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open

    # Standard Un*x password updating.

    @include common-password

    # Google Authentication

    auth required pam_google_authenticator.so nullok


    /etc/ssh/sshd_config

    Spoiler anzeigen

    # $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $

    # This is the sshd server system-wide configuration file. See

    # sshd_config(5) for more information.

    # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

    # The strategy used for options in the default sshd_config shipped with

    # OpenSSH is to specify options with their default value where

    # possible, but leave them commented. Uncommented options override the

    # default value.

    Port 2788

    Protocol 2

    #AddressFamily any

    #ListenAddress 0.0.0.0

    #ListenAddress ::

    #HostKey /etc/ssh/ssh_host_rsa_key

    #HostKey /etc/ssh/ssh_host_ecdsa_key

    HostKey /etc/ssh/ssh_host_ed25519_key

    # Ciphers and keying:

    #RekeyLimit default none

    # Logging:

    SyslogFacility AUTH

    LogLevel INFO

    # Authentication:

    LoginGraceTime 15s

    PermitRootLogin no

    StrictModes yes

    MaxAuthTries 5

    MaxSessions 2

    # Hinzugefuegt von @Brandt:

    DenyUsers root

    DenyGroups root

    AllowUsers Brandt GameserverRoot VoiceserverRoot

    AllowGroups SSHManager GameserverRoot VoiceserverRoot

    PubkeyAuthentication yes

    # Expect .ssh/authorized_keys2 to be disregarded by default in future.

    AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys1 %h/.ssh/authorized_keys2

    #AuthorizedPrincipalsFile none

    #AuthorizedKeysCommand none

    #AuthorizedKeysCommandUser nobody

    # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts

    HostbasedAuthentication no

    # Change to yes if you don't trust ~/.ssh/known_hosts for

    # HostbasedAuthentication

    #IgnoreUserKnownHosts no

    # Don't read the user's ~/.rhosts and ~/.shosts files

    IgnoreRhosts yes

    # To disable tunneled clear text passwords, change to no here!

    PasswordAuthentication yes

    PermitEmptyPasswords no

    # Change to yes to enable challenge-response passwords (beware issues with

    # some PAM modules and threads)

    ChallengeResponseAuthentication yes

    # Kerberos options

    #KerberosAuthentication no

    #KerberosOrLocalPasswd yes

    #KerberosTicketCleanup yes

    #KerberosGetAFSToken no

    # GSSAPI options

    #GSSAPIAuthentication no

    #GSSAPICleanupCredentials yes

    #GSSAPIStrictAcceptorCheck yes

    #GSSAPIKeyExchange no

    # 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

    #AllowAgentForwarding yes

    #AllowTcpForwarding yes

    #GatewayPorts no

    X11Forwarding no

    X11DisplayOffset 10

    #X11UseLocalhost yes

    #PermitTTY yes

    PrintMotd no

    PrintLastLog yes

    TCPKeepAlive yes

    #UseLogin no

    UsePrivilegeSeparation yes

    #PermitUserEnvironment no

    #Compression delayed

    #ClientAliveInterval 0

    #ClientAliveCountMax 3

    #UseDNS no

    #PidFile /var/run/sshd.pid

    MaxStartups 30

    #PermitTunnel no

    #ChrootDirectory none

    #VersionAddendum none

    # no default banner path

    Banner /etc/ssh/AnmeldeBanner

    # Allow client to pass locale environment variables

    AcceptEnv LANG LC_*

    # override default of no subsystems

    Subsystem sftp /usr/lib/openssh/sftp-server

    # Example of overriding settings on a per-user basis

    Match User Brandt Group SSHManager

    AuthenticationMethods publickey,keyboard-interactive

    PasswordAuthentication no

    Match all

    AuthenticationMethods publickey,password

    PasswordAuthentication yes

    Ich bitte für das "Spammen" um Entschuldigung, bin aber langsam aber sich mit meinen Latein am ende und weiß nicht mehr weiter.


    Mit freundlichen Grüßen


    Brandt

    Es tut mir leid dass ich mich erst jetzt wieder melde, hatte etwas viel um die Ohren und konnte den Server im moment nicht weiter betreiben/betreuen.

    Ich habe jetzt das problem, dass der user Brandt funktioniert aber die User GameserverRoot und VoiceserverRoot nicht wirklich.

    Wenn ich mich versuche mit einen der beiden per SSH zu verbinden werde ich nach dem Passwort gefragt, wenn ich dieses jedoch eingebe erhalte ich ein Access denied.

    Hier meine Config´s

    /etc/pam.d/sshd

    Spoiler anzeigen

    # PAM configuration for the Secure Shell service

    # Standard Un*x authentication.

    #@include common-auth

    # Disallow non-root logins when /etc/nologin exists.

    account required pam_nologin.so

    # Uncomment and edit /etc/security/access.conf if you need to set complex

    # access limits that are hard to express in sshd_config.

    # account required pam_access.so

    # Standard Un*x authorization.

    @include common-account

    # SELinux needs to be the first session rule. This ensures that any

    # lingering context has been cleared. Without this it is possible that a

    # module could execute code in the wrong domain.

    session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close

    # Set the loginuid process attribute.

    session required pam_loginuid.so

    # Create a new session keyring.

    session optional pam_keyinit.so force revoke

    # Standard Un*x session setup and teardown.

    @include common-session

    # Print the message of the day upon successful login.

    # This includes a dynamically generated part from /run/motd.dynamic

    # and a static (admin-editable) part from /etc/motd.

    session optional pam_motd.so motd=/run/motd.dynamic

    session optional pam_motd.so noupdate

    # Print the status of the user's mailbox upon successful login.

    session optional pam_mail.so standard noenv # [1]

    # Set up user limits from /etc/security/limits.conf.

    session required pam_limits.so

    # Read environment variables from /etc/environment and

    # /etc/security/pam_env.conf.

    session required pam_env.so # [1]

    # In Debian 4.0 (etch), locale-related environment variables were moved to

    # /etc/default/locale, so read that as well.

    session required pam_env.so user_readenv=1 envfile=/etc/default/locale

    # SELinux needs to intervene at login time to ensure that the process starts

    # in the proper default security context. Only sessions which are intended

    # to run in the user's context should be run after this.

    session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open

    # Standard Un*x password updating.

    @include common-password

    # Google Authentication

    auth required pam_google_authenticator.so

    /etc/ssh/sshd_config

    Spoiler anzeigen

    # $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $

    # This is the sshd server system-wide configuration file. See

    # sshd_config(5) for more information.

    # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

    # The strategy used for options in the default sshd_config shipped with

    # OpenSSH is to specify options with their default value where

    # possible, but leave them commented. Uncommented options override the

    # default value.

    Port 2788

    Protocol 2

    #AddressFamily any

    #ListenAddress 0.0.0.0

    #ListenAddress ::

    #HostKey /etc/ssh/ssh_host_rsa_key

    #HostKey /etc/ssh/ssh_host_ecdsa_key

    HostKey /etc/ssh/ssh_host_ed25519_key

    # Ciphers and keying:

    #RekeyLimit default none

    # Logging:

    SyslogFacility AUTH

    LogLevel INFO

    # Authentication:

    LoginGraceTime 15s

    PermitRootLogin no

    StrictModes yes

    MaxAuthTries 5

    MaxSessions 2

    DenyUsers root

    DenyGroups root

    AllowUsers Brandt GameserverRoot VoiceserverRoot

    AllowGroups GameserverRoot VoiceserverRoot

    PubkeyAuthentication yes

    # Expect .ssh/authorized_keys2 to be disregarded by default in future.

    AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys1 %h/.ssh/authorized_keys2

    #AuthorizedPrincipalsFile none

    #AuthorizedKeysCommand none

    #AuthorizedKeysCommandUser nobody

    # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts

    HostbasedAuthentication no

    # Change to yes if you don't trust ~/.ssh/known_hosts for

    # HostbasedAuthentication

    #IgnoreUserKnownHosts no

    # Don't read the user's ~/.rhosts and ~/.shosts files

    IgnoreRhosts yes

    # To disable tunneled clear text passwords, change to no here!

    PasswordAuthentication yes

    PermitEmptyPasswords no

    # Change to yes to enable challenge-response passwords (beware issues with

    # some PAM modules and threads)

    ChallengeResponseAuthentication yes

    # Kerberos options

    #KerberosAuthentication no

    #KerberosOrLocalPasswd yes

    #KerberosTicketCleanup yes

    #KerberosGetAFSToken no

    # GSSAPI options

    #GSSAPIAuthentication no

    #GSSAPICleanupCredentials yes

    #GSSAPIStrictAcceptorCheck yes

    #GSSAPIKeyExchange no

    # 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

    #AllowAgentForwarding yes

    #AllowTcpForwarding yes

    #GatewayPorts no

    X11Forwarding no

    X11DisplayOffset 10

    #X11UseLocalhost yes

    #PermitTTY yes

    PrintMotd no

    PrintLastLog yes

    TCPKeepAlive yes

    #UseLogin no

    UsePrivilegeSeparation yes

    #PermitUserEnvironment no

    #Compression delayed

    #ClientAliveInterval 0

    #ClientAliveCountMax 3

    #UseDNS no

    #PidFile /var/run/sshd.pid

    MaxStartups 30

    #PermitTunnel no

    #ChrootDirectory none

    #VersionAddendum none

    # no default banner path

    Banner /etc/ssh/AnmeldeBanner

    # Allow client to pass locale environment variables

    AcceptEnv LANG LC_*

    # override default of no subsystems

    Subsystem sftp /usr/lib/openssh/sftp-server

    # Example of overriding settings on a per-user basis

    Match User Brandt Group SSHManager

    AuthenticationMethods publickey,keyboard-interactive

    Match All

    AuthenticationMethods password,publickey

    Ich hoffe man kann mir erneut weiterhelfen.


    Mit freundlichen Grüßen


    Brandt

    Kalle12 vielen dank für deine Hilfe, leider funktioniert es nur würde ich sagen teilweise.


    Es funktioniert alles außer mit dem User (Brandt) leider nicht, wenn ich mich hierüber versuche anzumelden, erhalte ich folgendes Problem:

    Spoiler anzeigen

    Authenticating with public key "Brandt@ProjectPowerGaming"

    Passphrase for key "Brandt@ProjectPowerGaming":

    Further authentication required

    Using keyboard-interactive authentication.

    Password:

    Access denied

    Aus irgendeinem mir nicht bekannten Grund wird das Passwort nicht angenommen, wobei hier auch gar keins auftauchen/abgefragt werden soll, sondern nur der publickey und der Verification code.


    Hier nochmals meine sshd_config

    Spoiler anzeigen

    # $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $

    # This is the sshd server system-wide configuration file. See

    # sshd_config(5) for more information.

    # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

    # The strategy used for options in the default sshd_config shipped with

    # OpenSSH is to specify options with their default value where

    # possible, but leave them commented. Uncommented options override the

    # default value.

    Port 2788

    Protocol 2

    #AddressFamily any

    #ListenAddress 0.0.0.0

    #ListenAddress ::

    #HostKey /etc/ssh/ssh_host_rsa_key

    #HostKey /etc/ssh/ssh_host_ecdsa_key

    HostKey /etc/ssh/ssh_host_ed25519_key

    # Ciphers and keying:

    #RekeyLimit default none

    # Logging:

    SyslogFacility AUTH

    LogLevel INFO

    # Authentication:

    LoginGraceTime 25s

    PermitRootLogin no

    StrictModes yes

    MaxAuthTries 5

    MaxSessions 2

    # Hinzugefuegt von @Brandt:

    DenyUsers root

    DenyGroups root

    AllowUsers Brandt GameserverRoot VoiceserverRoot

    AllowGroups SSHManager GameserverRoot VoiceserverRoot

    PubkeyAuthentication yes

    # Expect .ssh/authorized_keys2 to be disregarded by default in future.

    AuthorizedKeysFile %h/.ssh/authorized_keys .ssh/authorized_keys1 .ssh/authorized_keys2

    #AuthorizedPrincipalsFile none

    #AuthorizedKeysCommand none

    #AuthorizedKeysCommandUser nobody

    # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts

    HostbasedAuthentication no

    # Change to yes if you don't trust ~/.ssh/known_hosts for

    # HostbasedAuthentication

    #IgnoreUserKnownHosts no

    # Don't read the user's ~/.rhosts and ~/.shosts files

    IgnoreRhosts yes

    # To disable tunneled clear text passwords, change to no here!

    #PasswordAuthentication yes

    PermitEmptyPasswords no

    # Change to yes to enable challenge-response passwords (beware issues with

    # some PAM modules and threads)

    ChallengeResponseAuthentication yes

    # Kerberos options

    #KerberosAuthentication no

    #KerberosOrLocalPasswd yes

    #KerberosTicketCleanup yes

    #KerberosGetAFSToken no

    # GSSAPI options

    #GSSAPIAuthentication no

    #GSSAPICleanupCredentials yes

    #GSSAPIStrictAcceptorCheck yes

    #GSSAPIKeyExchange no

    # 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

    #AllowAgentForwarding yes

    #AllowTcpForwarding yes

    #GatewayPorts no

    X11Forwarding no

    X11DisplayOffset 10

    #X11UseLocalhost yes

    #PermitTTY yes

    PrintMotd no

    PrintLastLog yes

    TCPKeepAlive yes

    #UseLogin no

    UsePrivilegeSeparation yes

    #PermitUserEnvironment no

    #Compression delayed

    #ClientAliveInterval 0

    #ClientAliveCountMax 3

    #UseDNS no

    #PidFile /var/run/sshd.pid

    MaxStartups 30

    #PermitTunnel no

    #ChrootDirectory none

    #VersionAddendum none

    # no default banner path

    Banner /etc/ssh/AnmeldeBanner

    # Allow client to pass locale environment variables

    AcceptEnv LANG LC_*

    # override default of no subsystems

    Subsystem sftp /usr/lib/openssh/sftp-server

    # Example of overriding settings on a per-user basis

    Match User Brandt Group SSHManager

    AuthenticationMethods publickey,keyboard-interactive

    PasswordAuthentication no

    Match All

    AuthenticationMethods publickey,password

    PasswordAuthentication yes


    Und die Datei aus /etc/pam.d/sshd

    Spoiler anzeigen

    # PAM configuration for the Secure Shell service

    # Standard Un*x authentication.

    @include common-auth

    # Disallow non-root logins when /etc/nologin exists.

    account required pam_nologin.so

    # Uncomment and edit /etc/security/access.conf if you need to set complex

    # access limits that are hard to express in sshd_config.

    # account required pam_access.so

    # Standard Un*x authorization.

    @include common-account

    # SELinux needs to be the first session rule. This ensures that any

    # lingering context has been cleared. Without this it is possible that a

    # module could execute code in the wrong domain.

    session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close

    # Set the loginuid process attribute.

    session required pam_loginuid.so

    # Create a new session keyring.

    session optional pam_keyinit.so force revoke

    # Standard Un*x session setup and teardown.

    @include common-session

    # Print the message of the day upon successful login.

    # This includes a dynamically generated part from /run/motd.dynamic

    # and a static (admin-editable) part from /etc/motd.

    session optional pam_motd.so motd=/run/motd.dynamic

    session optional pam_motd.so noupdate

    # Print the status of the user's mailbox upon successful login.

    session optional pam_mail.so standard noenv # [1]

    # Set up user limits from /etc/security/limits.conf.

    session required pam_limits.so

    # Read environment variables from /etc/environment and

    # /etc/security/pam_env.conf.

    session required pam_env.so # [1]

    # In Debian 4.0 (etch), locale-related environment variables were moved to

    # /etc/default/locale, so read that as well.

    session required pam_env.so user_readenv=1 envfile=/etc/default/locale

    # SELinux needs to intervene at login time to ensure that the process starts

    # in the proper default security context. Only sessions which are intended

    # to run in the user's context should be run after this.

    session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open

    # Standard Un*x password updating.

    @include common-password

    # Google Authentication

    auth required pam_google_authenticator.so nullok

    Mit freundlichen Grüßen


    Brandt

    Vielen Dank Martha es Funktioniert jetzt.

    Ich habe aber jetzt noch eine "Kleinigkeit" bei der ich nicht so ganz weiterkomme, ich versuche (und das jetzt schon etwas länger) es so einzustellen, dass der User (Brandt) und dessen Gruppe (SSHManager) sich im Gegensatz zu den Gruppen/Usern (GameserverRoot & VoiceserverRoot) ohne ein Passwort und die anderen beiden mit einem Passwort anmelden sollen. Leider meldet sich der User (Brandt) jetzt mit einer 3 Schritte Authentifizierung an.

    Einmal mit dem Public_key, dem Passwort und dem Verification code.

    Wobei das Passwort nicht bei dem User Brandt auftauchen sollte.

    Hier mal die Dinge die ich geändert bzw. Unternommen habe:

    Die Datei aus /etc/pam.d/sshd

    Spoiler anzeigen

    # Standard Un*x authentication.

    #@include common-auth

    # Google Authentication

    auth required pam_google_authenticator.so nullok

    Die sshd-config

    Spoiler anzeigen

    # $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $

    # This is the sshd server system-wide configuration file. See

    # sshd_config(5) for more information.

    # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

    # The strategy used for options in the default sshd_config shipped with

    # OpenSSH is to specify options with their default value where

    # possible, but leave them commented. Uncommented options override the

    # default value.

    Port 22

    Protocol 2

    #AddressFamily any

    #ListenAddress 0.0.0.0

    #ListenAddress ::

    #HostKey /etc/ssh/ssh_host_rsa_key

    #HostKey /etc/ssh/ssh_host_ecdsa_key

    HostKey /etc/ssh/ssh_host_ed25519_key

    # Ciphers and keying:

    #RekeyLimit default none

    # Logging:

    SyslogFacility AUTH

    LogLevel INFO

    # Authentication:

    LoginGraceTime 15s

    PermitRootLogin no

    StrictModes yes

    MaxAuthTries 5

    MaxSessions 2

    DenyUsers root

    DenyGroups root

    AllowUsers Brandt GameserverRoot VoiceserverRoot

    AllowGroups SSHManager GameserverRoot VoiceserverRoot

    # Expect .ssh/authorized_keys2 to be disregarded by default in future.

    AuthorizedKeysFile %h/.ssh/authorized_keys

    #AuthorizedPrincipalsFile none

    #AuthorizedKeysCommand none

    #AuthorizedKeysCommandUser nobody

    # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts

    HostbasedAuthentication no

    # Change to yes if you don't trust ~/.ssh/known_hosts for

    # HostbasedAuthentication

    #IgnoreUserKnownHosts no

    # Don't read the user's ~/.rhosts and ~/.shosts files

    IgnoreRhosts yes

    RhostsRSAAuthentication no

    #IgnoreUserKnowHosts yes

    # 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

    # Kerberos options

    #KerberosAuthentication no

    #KerberosOrLocalPasswd yes

    #KerberosTicketCleanup yes

    #KerberosGetAFSToken no

    # GSSAPI options

    #GSSAPIAuthentication no

    #GSSAPICleanupCredentials yes

    #GSSAPIStrictAcceptorCheck yes

    #GSSAPIKeyExchange no

    # 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,keyboard-interactive

    #AllowAgentForwarding yes

    #AllowTcpForwarding yes

    #GatewayPorts no

    X11Forwarding no

    X11DisplayOffset 10

    #X11UseLocalhost yes

    #PermitTTY yes

    PrintMotd no

    PrintLastLog yes

    TCPKeepAlive yes

    #UseLogin no

    UsePrivilegeSeparation yes

    #PermitUserEnvironment no

    #Compression delayed

    #ClientAliveInterval 0

    #ClientAliveCountMax 3

    #UseDNS no

    #PidFile /var/run/sshd.pid

    MaxStartups 30

    #PermitTunnel no

    #ChrootDirectory none

    #VersionAddendum none

    # Lifetime and size of ephemeral version 1 server key

    KeyRegenerationInterval 3600

    ServerKeyBits 768

    # no default banner path

    #banner none

    # Allow client to pass locale environment variables

    AcceptEnv LANG LC_*

    # override default of no subsystems

    Subsystem sftp /usr/lib/openssh/sftp-server

    Match User GameserverRoot,VoiceserverRoot Group GameserverRoot,VoiceserverRoot

    AuthenticationMethods password publickey

    PasswordAuthentication yes

    #PubkeyAuthentication no

    Match User Brandt Group SSHManager

    AuthenticationMethods publickey,keyboard-interactive

    PasswordAuthentication no

    #PubkeyAuthentication yes


    Ich hoffe mir kann erneut geholfen werden und vielleicht könnt Ihr mir helfen die sshd_config ein wenig zu "entmüllen" oder mir Tipps geben was da eigentlich total "unnötig" ist.

    Ich hoffe ich habe alles verständlich aufgeschrieben.


    Mit freundlichen Grüßen

    Brandt

    Ich bin mir nicht sicher ob ich etwas überlesen oder nicht ganz verstanden habe?

    Dann hast du ziemlich sicher ein Jail für SSH in Fail2ban aktiv und deshalb wirst du geblockt.

    Die sshd Jail habe ich auf enabled = true stehen.

    Entweder deaktivierst du Fail2ban oder du setzt deine IP auf eine Whitelist.

    Das geht mit meiner IP leider nicht, und deaktivieren möchte ich es ungern.

    Gibt es eine Möglichkeit über eine neue Jail den google-authenticator hinzuzufügen, und somit einstellen zu können nach wie vielen Versuchen man gelockt wird oder hängt gerade das mit der sshd Jail zusammen?

    Wenn du password aktiv lässt, kann man sich nicht nur mit dem Public Key anmelden (das ist der wünschenswerte Zustand) sondern auch mit einem Passwort (das sollte deaktiviert sein). Da sollte nur AuthenticationMethods publickey,keyboard-interactive stehen. keyboard-interactive ist für Eingabe des Verification Codes notwendig.

    Ist damit gemeint dass wenn ich nur AuthenticationMethods publickey,keyboard-interactive verwende, das denn beim erneuten SSH Login nur Verification code: angezeigt wird und der Public Key im Hintergrund "abgefragt" wird nur ohne eine Passwort Aufforderung bzw. Eingabe?

    Die Zeile sieht seltsam aus. Ansonsten, ist Fail2ban aktiv? Das erkennt so etwas und blockiert dich.

    Meinst du damit, wenn ich den Befehl etc/init.d/fail2ban status eingebe und etwas weiter unten

    Active: active (running) steht?

    AuthenticationMethods publickey,keyboard-interactive

    Was ist hier mit password publickey, ist das nicht für die Eingabe der Passphrase des Benutzers? Oder wozu?

    Normalerweise wird der Public Key ohne Eingabe automatisch erkannt (oder hast du ein Passwort für die Nutzung des Keys vergeben?). Du musst nur den Verification Code eingeben.

    Also wenn ich mich per SSH anmelde muss ich das Passwort für Passphrase for key "Brandt@server": und Verification code: eingeben.

    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:

    Spoiler anzeigen

    # Standard Un*x authentication.

    #@include common-auth

    # Google Authentication

    auth required pam_google_authenticator.so

    In der Datei / etc / ssh / sshd_config folgendes unternommen:

    Spoiler anzeigen

    # 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

    Du laesst doch aber in der sshd_config nur den User brandt zu, wieso benutzt du dann den User root ?

    Weil ich mit den user root zuerst den public key erstellen muss. Oder wie sonst?

    8. weil in den Protokollen steht, was du tust und was nicht funktioniert bzw. warum.

    Mit dem Punkt bin ich immer noch etwas "überfordert" da ich dort nicht weiß was zu tun ist.

    Kannst du mir eine Anleitung zeigen vom Command ssh-keygen -t ed25519 -o -a 100 bis zum erfolgreichen loggin des Benutzers brandt was genau eingebeben werden muss? Da mir die meisten Anleitungen die Ich gefunden habe nicht weiterhelfen.

    Mit dieser ausführlichen Fehlerbeschreibung kann ich leider nichts anfangen. Du schreibst, du hast den Rootserver neu aufgesetzt. Was hast du dann gemacht und was funktioniert nicht? Bist du nach einer Anleitung vorgegangen (welcher)?

    Sobald ich nach dem Loggin (in SSH) brandt eingebe und dann nach der Key-passphrase gefragt werde und die dann eingebe funktioniert sie nicht.

    Hast du da vllt. eine Idee?

    Ich habe es mal ausprobiert und hatte leider keinen Erfolg. Und eine Sache verstehe ich nicht ganz...

    Wieso habe ich es unter Debian 8 in unter 10Minuten (Bin Anfänger und habe ca. 10% Ahnung) geschafft die Public Key Authentifizierung zu erstellen (Die auch funktioniert hat) und bei Debian 9 nicht, das kann doch nicht war sein:cursing:

    Ich hoffe ihr habt irgendwelche anderen Tipps, wenn es hilft dass ich die sshd_config oder ssh_config (sind beide im Standard "zustand" da ich den Rootserver neu aufgesetzt habe, möchte erst den Rootserver absichern bevor ich irgendwas anderes mache) anhänge dann bitte bescheid geben.

    Das was du geschrieben hast verwirrt mich jetzt einwenig...

    Zu deinen Punkten:

    1. Debian 9 ist das Betriebssystem das ich installiert habe und die sshd_config ist aus etc/ssh/

    2. Was meinst du genau mit Client? Ich habe einen Linuxserver und nutze zum Steuern/Verwalten das Programm Putty.

    3. Wozu ist das Logging genau? Wie gesagt in der sshd_config sind die Dinge etwas anders aufgebaut als in Debian 8 (kann dir auch die Orginale sshd_config geben).

    4. Das war mein Fehler, da war ich etwas undeutlich in dem Verzeichnis home/brandt in dem Ordner brandt ist noch ein Ordner .ssh und dort ist der authorized_key.

    5. Momentan (ist ja klar) logge ich mich noch als root ein und "nach" der Absicherung wird/soll der root Zugang ja gesperrt werden und dann logge ich mich ausschließlich mit dem User brandt ein.

    6. Verwirrt mich etwas, wieso wird es "verhindert"? Ich dachte durch AllowUsers/AllowGroups wird ein User/eine Gruppe zugelassen und alles andere "geblockt"?

    7. Die Rechte für den User brandt habe ich mit usermod -aG ssh-manager brandt zugewiesen.

    8. Da verstehe ich nicht, was du mir sagen möchtest.

    MfG

    Ich habe dir mal meine sshd_config als Anhang geschickt, ich habe nur diese Config bearbeitet und via SSH in /home/user einen .ssh Ordner erstellt und mit folgenden befehlen bearbeitet:

    touch .ssh/authorized_keys

    chmod 700 .ssh

    chmod 600 .ssh/authorized_keys

    chown -R test:test .ssh

    Ansonsten habe ich nichts verändert oder sonstiges, ich hoffe das hilft dir auch weiter. Und ja ich habe einen Rootserver und habe darauf Debian 9 installiert wenn du das meinst.

    Wenn ich den Befehl ssh-keygen -t ed25519 -o -a 100 in ssh auf meinem Server eingebe dann bekomme ich ja 2 Dateien einmal eine id_ed25519 und eine id_ed25519.pub dann ist aber die Frage wie es genau weiter geht?

    Also was muss ich genau tun, ich frage das jetzt weil ich es sonst über Puttygen immer gemacht habe und dann einen Private key und einen public key hatte und den private key musste ich noch noch in Putty einfügen.