1833883 Members
1632 Online
110063 Solutions
New Discussion

Re: Symbolic link

 
Stoicho Valkov
Advisor

Symbolic link

Hi,
how can I change permissions and group of Symbolic link.
I am root and owner of the link is root too.
The system is HP-UX 11.0
Text editor
7 REPLIES 7
John Poff
Honored Contributor

Re: Symbolic link

Hi,

The ownership and permissions of the symbolic link really don't matter. The symlink just provides a pointer to another file and your access to that file depends on its ownership and permissions. If the ownership of the symlink really bothers you, you can remove it and recreate it as the user that you wish to own it.

rm symlink
su newuser
ln -s myfile symlink

That should give you a symlink owned by newuser.

JP
Michael Tully
Honored Contributor

Re: Symbolic link

Sometimes the symlink owner does matter.

On one of my systems which happens to use Informix XDS we had to create the sym links as the informix user instead of root. Because we use raw LV's the link and raw device must be owned by Informix. Yes highly strange but a requirement for this particular RDBMS. Using the procedure listed by JP will fix it.
Anyone for a Mutiny ?
malay boy
Trusted Contributor

Re: Symbolic link

yap-yap-yap..well said my master JP.The link permission is nothing but the permission of the base file are need to be correct.
You can have rwxrwxrwx for the link file but if the base file are r-------- then only root can read it.

regards
mB

OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime

p/s: uhm!!! which category are you ?.

There are three person in my team-Me ,myself and I.
T G Manikandan
Honored Contributor

Re: Symbolic link

to change the ownership,

remove the link and re-create the link using the user with which permissions are reqd.

THanks
Sunil Sharma_1
Honored Contributor

Re: Symbolic link

The ownership of symbolic link should not be matter becoz it is just pointer to original file and all effective permission is same as base file.

as other syas you can change ownership of file by creating as the desired user.
but will it make some sense ?

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Systeemingenieurs Infoc
Valued Contributor

Re: Symbolic link

You can change permissions of the symlink by setting your umask and then create the link.
A Life ? Cool ! Where can I download one of those from ?
John Meissner
Esteemed Contributor

Re: Symbolic link

the permissions of the link should not matter. Check the permissions of the original file to make sure the user has access to that. If it still doesn't work (as mentioned above) remove the link and create it again as the user who needs access.
All paths lead to destiny