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

by on February 5, 2006 · 3 comments· last updated at 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.



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 3 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

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as:

Previous Faq:

Next Faq: