I have access to a remote Linux machine where every time I create a symbolic link, it is created by default with the following permissions: lrwxrwxrwx

If I try to change the permissions of the symbolic link (i.e. not the path that it points to) using for example:

chmod g-w my_symbolic_link

chmod runs correctly (no error message is printed) but when I check the permissions again, they are still the same (lrwxrwxrwx).

I am waiting to hear from the machine administrator, but I was wondering if this is normal behavior, or if it is something specific to the box.


It's normal behavior. What happens can vary depending on the operating system (Solaris at least used to change the link permissions); but since a symlink isn't a normal file, the permissions don't actually get used for anything. (File permissions are part of the file's inode, so the symlink can't affect them.)

  • I see, thanks. I just want to prevent anybody from deleting the symbolic link. From what I understand then I cannot change the permission of this link without the help the administrator, correct? – Amelio Vazquez-Reina May 6 '11 at 19:48
  • 4
    Not even with the administrator's help. File deletion depends on the permissions of the containing directory, not on those of the file. (rm specifically checks the file for read-only unless you pass -f, because one usually doesn't intend a read-only file to be deleted, but unlink() doesn't care. Try it from Perl or Python sometime.) – geekosaur May 6 '11 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.