2

I recently had some problems I believe to be related to pam, but still for some reason there are no delay between login attempts.

When searching around, people seem to only have the opposite problem: That the delay is too long.

I thought this delay was hard coded into pam, which led me to sshd_config, but nothing there either.

Any tips for where to look is appreciated — what else than pam and sshd is involved in this process? And might it be a sign of a security breach (lots of strange IPs knocking on my door, as always), should I just reinstall the system?

The delay is there elsewhere, it's only when ssh'ing its gone.

/etc/ssh/sshd_config:

#   $OpenBSD: sshd_config,v 1.95 2015/04/27 21:42:48 djm 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
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# The default requires explicit activation of protocol 1
#Protocol 2

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024

# Ciphers and keying
#RekeyLimit default none

# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 3
#MaxSessions 2

#RSAAuthentication yes
#PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile  .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
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and 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 no to disable s/key passwords
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials 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

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no # pam does that
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
UsePrivilegeSeparation sandbox      # Default for new installations.
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem   sftp    /usr/lib/ssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#   X11Forwarding no
#   AllowTcpForwarding no
#   PermitTTY no
#   ForceCommand cvs server

cat /etc/pam.d/*:

#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_permit.so
#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_permit.so
#%PAM-1.0
auth        sufficient  pam_rootok.so
account     required    pam_permit.so
password    include     system-auth
#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_unix.so sha512 shadow
#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_permit.so
#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_permit.so
#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_permit.so
#%PAM-1.0
auth        sufficient  pam_rootok.so
account     required    pam_permit.so
password    include     system-auth
#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_permit.so
#%PAM-1.0

auth       required     pam_securetty.so
auth       requisite    pam_nologin.so
auth       include      system-local-login
account    include      system-local-login
session    include      system-local-login
#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_unix.so sha512 shadow
#%PAM-1.0
auth        required    pam_unix.so
account     required    pam_unix.so
password    required    pam_unix.so
session     required    pam_unix.so
#%PAM-1.0
#password   required    pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
#password   required    pam_unix.so sha512 shadow use_authtok
password    required    pam_unix.so sha512 shadow nullok
#%PAM-1.0
# For root login to succeed here with pam_securetty, "rlogin" must be
# listed in /etc/securetty.
auth       required     pam_nologin.so
auth       required     pam_securetty.so
auth       required     pam_env.so
auth       sufficient   pam_rhosts.so
auth       include      system-auth
account    include      system-auth
password   include      system-auth
session    optional     pam_keyinit.so    force revoke
session    required     pam_loginuid.so
session    include      system-auth
#%PAM-1.0
# For root login to succeed here with pam_securetty, "rsh" must be
# listed in /etc/securetty.
auth       required     pam_nologin.so
auth       required     pam_securetty.so
auth       required     pam_env.so
auth       required     pam_rhosts.so
account    include      system-auth
session    optional     pam_keyinit.so    force revoke
session    required     pam_loginuid.so
session    include      system-auth
auth        required    pam_unix.so
#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_permit.so
#%PAM-1.0
#auth     required  pam_securetty.so     #disable remote root
auth      include   system-remote-login
account   include   system-remote-login
password  include   system-remote-login
session   include   system-remote-login
#%PAM-1.0
auth        sufficient  pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth       sufficient  pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth       required    pam_wheel.so use_uid
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
#%PAM-1.0
auth        sufficient  pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth       sufficient  pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth       required    pam_wheel.so use_uid
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
#%PAM-1.0
auth        include     system-auth
account     include     system-auth
session     include     system-auth
#%PAM-1.0

auth      required  pam_unix.so     try_first_pass nullok
auth      optional  pam_permit.so
auth      required  pam_env.so

account   required  pam_unix.so
account   optional  pam_permit.so
account   required  pam_time.so

password  required  pam_unix.so     try_first_pass nullok sha512 shadow
password  optional  pam_permit.so

session   required  pam_limits.so
session   required  pam_unix.so
session   optional  pam_permit.so
#%PAM-1.0

auth      include   system-login
account   include   system-login
password  include   system-login
session   include   system-login
#%PAM-1.0

auth       required   pam_tally.so         onerr=succeed file=/var/log/faillog
auth       required   pam_shells.so
auth       requisite  pam_nologin.so
auth       include    system-auth

account    required   pam_access.so
account    required   pam_nologin.so
account    include    system-auth

password   include    system-auth

session    optional   pam_loginuid.so
session    include    system-auth
session    optional   pam_motd.so          motd=/etc/motd
session    optional   pam_mail.so          dir=/var/spool/mail standard quiet
-session   optional   pam_systemd.so
session    required   pam_env.so
#%PAM-1.0

auth      include   system-login
account   include   system-login
password  include   system-login
session   include   system-login
#%PAM-1.0

auth      sufficient  pam_permit.so

account   include     system-auth

session   optional    pam_loginuid.so
session   required    pam_limits.so
session   required    pam_unix.so
session   optional    pam_permit.so
session   required    pam_env.so
# This file is part of systemd.
#
# Used by systemd --user instances.

account  include system-login

session  include system-login
#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_permit.so
#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_permit.so
#%PAM-1.0
auth        sufficient  pam_rootok.so
auth        required    pam_unix.so
account     required    pam_unix.so
session     required    pam_unix.so
password    required    pam_permit.so

As always, please let me know if you need more info.

  • In the PAM configs, including the filenames might be useful as well... for f in /etc/pam.d/*; do echo $f; cat $f; echo; done – Gert van den Berg Nov 23 '15 at 14:10
  • Looks like you are not using pam_faildelay, which is what creates the delay. – jordanm Nov 23 '15 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.