大网数据广告活动
服务器运维问答

sudo does not prompt for password and reports 3 incorrect password attempts

· 52CE 我爱测

User smithj is listed in the /etc/sudoers file: root ALL=(ALL) ALL smithj ALL=(ALL) ALL smithj logs into the system via putty. He attempts to sudo but gets this: sudo adduser jonesjp Sorry, try again. Sorry, try again. Sorry, try…

问题原文

原帖链接 · Paul Croarkin · CC BY-SA 3.0

User smithj is listed in the /etc/sudoers file:

root ALL=(ALL) ALL
smithj ALL=(ALL) ALL

smithj logs into the system via putty. He attempts to sudo but gets this:

sudo adduser jonesjp
Sorry, try again.
Sorry, try again.
Sorry, try again.
sudo: 3 incorrect password attempts

He is never prompted for his password. This is on CentOS 6.

This used to work, but another admin made some unknown changes that resulted in this and he is not available.

已采纳解答

原帖链接 · Joshua Miller · CC BY-SA 4.0

Some things to check:

Have the user run sudo -l. This just asks sudo to tell you what permissions you have. If you can't manage this, there's a fundamental issue authenticating that's probably separate from sudo itself.

Compare /etc/pam.d/sudo with other functional systems (or backups).

Compare /etc/pam.d/system-auth with other functional systems (or backups). Subtle changes to this system can introduce gnarly troubleshooting problems.

Look at /etc/pam.d/system-auth and see if the pam_access.so module is in use. If so, you'll want to check whether smithj is allowed in /etc/security/access.conf (unless another file is specified by the PAM module). One potentially tricky problem is if the account is allowed access from a remote IP, but not locally; this ends up allowing a remote log in, but local actions like cron jobs and sudo authentications fail.

Is smithj logging in via password? Or via keys? Make sure they can log in with a password to help narrow the problem. If they can't successfully use their password anywhere, start looking at changes against /etc/passwd, /etc/shadow, /etc/nsswitch.conf, and any config files associated with the directory you're using (perhaps none, perhaps LDAP, NIS, AD).

If you have a caching daemon running, perhaps nscd or sssd, restart the daemon (sudo service nscd restart). These daemons are notorious for having problems.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-10-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。