0

When root or using sudo, I cannot write to some files.

I have a file fileA with permissions 750

fileA rwxr_x___ root root

When I run a program as root or using sudo, the system prompt is:

no write permission to this file.

What can be the possible reason?

5
  • 1
    What program are you trying to run on the file? Can you append to the file? echo EXTRA >> fileA Jul 31, 2014 at 15:25
  • The file is on a CDROM, or a file system which has been marked read-only due to errors?
    – pjc50
    Jul 31, 2014 at 15:37
  • We need more information. The group permission clearly indicates write permissions isn't allowed.
    – Ramhound
    Jul 31, 2014 at 15:53
  • @Ramhound: The group is root, but so is the owner. The owner has write attributes, so it should be working. Jul 31, 2014 at 16:00
  • I was just pointing out something that was odd. Is linux persmisions not normally "owner-group-everyone'else"?
    – Ramhound
    Jul 31, 2014 at 16:07

2 Answers 2

2

Run lsattr and make sure the files don't have the i attribute set. That means "immutable", and when it is set, nobody - not even root - can change them.

0

Check to make sure that the files are not located on a read only device, or that the device is mounted as read only.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .