sudo fails if password expired at CentOS 7

General support questions
Post Reply
dinesmur@cisco.com
Posts: 2
Joined: 2020/04/22 06:37:19

sudo fails if password expired at CentOS 7

Post by dinesmur@cisco.com » 2020/04/22 07:22:07

Hello,

Below here have explained the sudo issue which is occurred in CentOS 7

Problem
sudo fails when the password has expired in centOS 7

Steps to Reproduce
1.expire users password
2.attempt to use sudo
E.g.
sudo echo "test" > file.txt
/usr/bin/chage -d0 root
sudo echo "test" > file1.txt
Error:
sudo: Account or password is expired, reset your password and try again
sudo: no tty present and no askpass program specified
sudo: unable to change expired password: Authentication token manipulation error

These steps are working perfectly in CentOS 6, but not it CentOS7

Redhat Bugzilla Response

Found the same kind of bug report in Bugzilla, https://bugzilla.redhat.com/show_bug.cgi?id=1713448
Here they commented as it was fixed and released patches, but it is not working in the latest CentOS 7. sudo-1.8.23-4.el7_7.2.x86_64.rpm is used in the latest centOS 7.
In addition that tried with given workaround solution as Add the following line to /etc/sudoers: Defaults !pam_session, but it also not working.

Looking solution to resolve the issue.

Thanks in advance.

Regards
Dinesh

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: sudo fails if password expired at CentOS 7

Post by TrevorH » 2020/04/22 09:05:18

Update to the copy of sudo in the CR repo using yum --enablerepo=cr update sudo
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

dinesmur@cisco.com
Posts: 2
Joined: 2020/04/22 06:37:19

Re: sudo fails if password expired at CentOS 7

Post by dinesmur@cisco.com » 2020/04/24 13:37:36

Thanks for your quick response.

After executing the given command, sudo rpm is upgraded from sudo-1.8.23-4.el7_7.2.x86_64 to sudo-1.8.23-9.el7.x86_64
but still facing the same issue, kindly provide the alternate solution to resolve.

Regards
Dinesh

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: sudo fails if password expired at CentOS 7

Post by aks » 2020/04/27 17:52:10

sudo fails when the password has expired in centOS 7
Frankly that's reasonable (and sudo is a part of the PAM stack).

Post Reply