4

I need to manage a customer's openvz guest (latest debian squeeze 64 bit). Now when I try to do a chmod 0750 /root as root it gives me Permission denied. This really puzzles me, as I thought root can do everything.

As far as I can tell there's no selinux running (is this possible at all in an openvz guest?). I looked into some logfiles (syslog, kern, dmesg) and didn't see any messages.

How can find why root is unable to chmod 0750 /root?

Update: It's even more weird as I also cannot create any files in /root. mkdir: cannot create directory '/root/test': Permission denied

gucki
  • 818
  • 2
  • 11
  • 29
  • Did you have SElinux enabled ? Maybe disabling or set to "permissive" the time to change/create whatever you need to. – Ouki Feb 17 '12 at 10:09
  • As I wrote: "As far as I can tell there's no selinux running (is this possible at all in an openvz guest?). I looked into some logfiles (syslog, kern, dmesg) and didn't see any messages.". How can I see if SElinux is enabled? – gucki Feb 17 '12 at 10:14
  • As a side note, you can make mounts read-only inside containers by doing `mount --bind -r /old /new` on the HN (see http://wiki.openvz.org/Bind_mounts). – Aleksandr Levchuk Feb 17 '12 at 19:46

1 Answers1

6

Ok, I just found out the directory was marked as "immutable" as can be checked with lsattr. After doing a chattr -i /root everything works now as expected :)

gucki
  • 818
  • 2
  • 11
  • 29