Can I set the permissions on a symbolic link under Linux/UNIX?

Posted on in Categories last updated September 1, 2006

No, you cannot. If you try to execute chmod command on a symbolic link, it will return with error Changing permissions of `filename’: Operation not permitted. This is quite logical, as permission on a symbolic link is meaningless. The only thing is important is permission on the file that the link points. In short, permissions on a symbolic link do not really mean anything.

4 comment

  1. soft links permissions are only for renaming the soft link and removal of the link itself thus the 777 permissions are not at all valid for changing the contents of the original file, or changing the contents of the file it shows through the cat command

  2. you can set with recursive option of ‘chown’; note that this will change the target permissions as well.

    bash$ chown -R root:root

  3. Hi, the webhost we are using disallows 0777 on directories which basically prevents me from using symbolic links on www/ dir, what can we do about this? not use symlink at all?

Leave a Comment