0

I have some issues with files /etc/passwd and /etc/shadow. Both of them are without permissions.

And I don't know how this happened or why. Basically I can't edit/remove these files or change permissions when I am logged as the root user. It ends with Operation not permitted. Eg. when I try:

root@server:/etc# chmod 600 passwd
chmod: changing permissions of ‘passwd’: Operation not permitted

Whats the fix???????

4
  • 1
    can you provide result of ls -l /etc/passwd /etc/shadow? Because it seems strange to change permissions on these 2 files
    – damadam
    Dec 2, 2019 at 16:12
  • even though you are "root" user you need to use sudo. I do agree with @damadam that it seems strange you need to chmod them, and would recommend caution.
    – Smurfz87
    Dec 2, 2019 at 16:17
  • @Smurfz87 - based on the prompt, he is root, so sudo is unnecessary. However, why is the OP changing permission of /etc/password to 600 (should be 644)? Are any other files affected; seems strange that only the aforementioned files have these permissions anomalies. Dec 2, 2019 at 16:34
  • The filesystem containing /etc is probably mounted read-only.
    – FedKad
    Dec 2, 2019 at 20:14

0

You must log in to answer this question.

Browse other questions tagged .