sudo su - 有 5 分钟的延迟,我应该回到原来的使用方式吗

sudo su - 有 5 分钟的延迟,我应该回到原来的使用方式吗

我们正在使用 ROcky linux 8.6 -

当我们输入 sudo su - 时,系统会提示我们登录,并且我们可以毫无问题地获得 root 用户身份。

如果我们输入 exit,我们就会按预期返回到原始用户。

如果我们再次直接输入 sudo su -,我们会得到 -

sudo:PAM 帐户管理错误:权限被拒绝

我们必须等待 5 分钟(或注销并登录)才能使其正常工作。

有人能告诉我们可能需要什么 pam.d 配置吗?谢谢


好的,对于那些要求我使用 sudo -i -u root 的人来说,发生了相同的行为。

[mlevine@bastionhostrl-101w ~]$ sudo -i -u root
[sudo] password for mlevine:
[root@bastionhostrl-101w ~]# exit
logout
[mlevine@bastionhostrl-101w ~]$ sudo -i -u root
sudo: PAM account management error: Permission denied
[mlevine@bastionhostrl-101w ~]$

我们使用的 Centos 主机上不会发生这种情况。我们自己登录 - 然后以这种方式将权限提升到 root。所以这不是答案 - 告诉我某事很愚蠢也无济于事。这太粗鲁了。

我们确实希望像这样在多次尝试时提示输入密码。我们的 sudoers 文件中没有时间戳设置。

当时在审计日志中列出 - 看起来故障锁正在产生,但我认为密码在 15 分钟内有效?

type=SERVICE_START msg=audit(1695911994.060:721): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=user-runtime-dir@806425 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'UID="root" AUID="unset"
type=SYSCALL msg=audit(1695911994.087:722): arch=c000003e syscall=257 success=yes exit=7 a0=ffffff9c a1=563ce2ed1330 a2=2 a3=0 items=1 ppid=1 pid=4846 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="(systemd)" exe="/usr/lib/systemd/systemd" key="logins"ARCH=x86_64 SYSCALL=openat AUID="unset" UID="root" GID="root" EUID="root" SUID="root" FSUID="root" EGID="root" SGID="root" FSGID="root"
type=CWD msg=audit(1695911994.087:722): cwd="/"
type=PATH msg=audit(1695911994.087:722): item=0 name="/var/run/faillock/mlevine" inode=105544 dev=00:17 mode=0100600 ouid=806425 ogid=0 rdev=00:00 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0OUID="mlevine" OGID="root"
type=PROCTITLE msg=audit(1695911994.087:722): proctitle="(systemd)"
type=USER_ACCT msg=audit(1695911994.090:723): pid=4846 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting grantors=? acct="mlevine" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'UID="root" AUID="unset"

我认为这是审计日志的一部分,显示成功然后失败。抱歉,如果我看起来不了解情况 - 在 CEntos 中从未遇到过这个问题


pam.d/su 的内容

#%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            substack        system-auth
auth            include         postlogin
account         sufficient      pam_succeed_if.so uid = 0 use_uid quiet
account         include         system-auth
password        include         system-auth
session         include         system-auth
session         include         postlogin
session         optional        pam_xauth.so

我的群组

uid=806425(mlevine) gid=200(unixusers) groups=200(unixusers),10(wheel),707(fndsysadmin),33004(aosysadmins),210039(dev_linux_syseng)

相关内容