≡ Menu

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

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 comments… add one }

  • satish December 14, 2007, 10:42 am

    can i give to permission for link file in linux

  • saransh srivastava April 18, 2010, 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

  • coolfire June 19, 2012, 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

  • Albert January 28, 2014, 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?

Leave a Comment