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

by on February 5, 2006 · 4 comments· LAST UPDATED September 1, 2006

in

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.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 4 comments… read them below or add one }

1 satish December 14, 2007 at 10:42 am

can i give to permission for link file in linux

Reply

2 saransh srivastava April 18, 2010 at 11:07 am

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

Reply

3 coolfire June 19, 2012 at 6:52 am

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

bash$ chown -R root:root

Reply

4 Albert January 28, 2014 at 9:52 pm

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?

Reply

Leave a Comment

Tagged as:

Previous Faq:

Next Faq: