Permission Denied when change password even as root

Support for security such as Firewalls and securing linux
Post Reply
geolee76
Posts: 1
Joined: 2019/09/06 22:15:39

Permission Denied when change password even as root

Post by geolee76 » 2019/09/06 22:19:39

We have this error message saying
Permission Denied
when attempt to change its own password as root user

the /etc/passwd is there and intact
there is another file /etc/passwd- in the same folder

Not sure what is the implications

We have tried reboot the server , however the error still persists

User avatar
TrevorH
Forum Moderator
Posts: 27125
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Permission Denied when change password even as root

Post by TrevorH » 2019/09/07 13:04:17

Despite its name, /etc/passwd is not used for storing passwords. For that you want /etc/shadow which should look like:

Code: Select all

[root@centos7 ~]# ls -laZ /etc/shadow
----------. root root system_u:object_r:shadow_t:s0    /etc/shadow
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

hunter86_bg
Posts: 1929
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Permission Denied when change password even as root

Post by hunter86_bg » 2019/09/14 19:16:32

I have seen similar behavior in this forum.
Run

Code: Select all

vipw
and immediately try to save .
If it fails - find the offending line and fix it.

Also, check the SELINUX context of :

Code: Select all

ls -lZ  /etc/{passwd*,shadow*}
If they deviate from standards -> run a

Code: Select all

restorecon
to fix the files.

Post Reply

Return to “CentOS 7 - Security Support”