Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have access to a remote Linux machine where everytime 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.

Thanks

share|improve this question

1 Answer 1

up vote 12 down vote accepted

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.)

share|improve this answer
    
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? –  user815423426 May 6 '11 at 19:48
3  
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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