Skip to main content
3 of 5
Copy edited (e.g. ref. <http://english.stackexchange.com/questions/4645/is-it-ever-correct-to-have-a-space-before-a-question-or-exclamation-mark#comment206109_4645>).

Symbolic link creation failing: change ownership issue

I am facing some issue with creating soft links. Following is the original file.

$ ls -l /etc/init.d/jboss -rwxr-xr-x 1 askar admin 4972 Mar 11 2014 /etc/init.d/jboss 

Link creation is failing with a permission issue for the owner of the file:

ln -sv jboss /etc/init.d/jboss1 ln: creating symbolic link `/etc/init.d/jboss1': Permission denied $ id uid=689(askar) gid=500(admin) groups=500(admin) 

So, I created the link with sudo privileges:

$ sudo ln -sv jboss /etc/init.d/jboss1 `/etc/init.d/jboss1' -> `jboss' $ ls -l /etc/init.d/jboss1 lrwxrwxrwx 1 root root 11 Jul 27 17:24 /etc/init.d/jboss1 -> jboss 

Next I tried to change the ownership of the soft link to the original user.

$ sudo chown askar.admin /etc/init.d/jboss1 $ ls -l /etc/init.d/jboss1 lrwxrwxrwx 1 root root 11 Jul 27 17:24 /etc/init.d/jboss1 -> jboss 

But the permission of the soft link is not getting changed.

What am I missing here to change the permission of the link?

Zama Ques
  • 3.4k
  • 13
  • 43
  • 54