Got an interesting, new error message tonight when trying to copy out a network config file to a new server:
scp: /etc/resolv.conf: Operation not permitted
The same error would present itself when I tried to edit the file in vi, or echo something to overwrite it. However, it would let me do a "echo # testing >> /etc/resolv.conf" so appending to the end of the file was working somehow. It turns out that ext filesystems, in addition to their read/write/execute permissions, also have "attributes". These can be used to, among other things, make it so a file can have things appended to it, but not be overwritten:
# lsattr /etc/resolv.conf -----a------- /etc/resolv.conf # chattr -a /etc/resolv.conf # lsattr /etc/resolv.conf ------------- /etc/resolv.conf
Why was resolv.conf set like this when I've never seen this before on any Linux system? I hope this was just a fluke and not part of some new update to Red Hat Enterprise Linux 3, but at least I know how to fix it if it crops up again. Hooray for the Ubuntu forums and their having a thread from a user who saw this happen in Ubuntu. And, of course, huzzah for man pages :)