1753481 Members
4497 Online
108794 Solutions
New Discussion юеВ

Re: Verysimple Question

 
dhanish
Regular Advisor

Verysimple Question

Hi,
I am not able to change the permissiond of a link under /sbin/rc2.d /S98ldapserver .I want to take the write permissions back ,at present its 777.this script is link to a script in /sbin/init.d/s98ldapserver.Can anyboy help me.
Never Say Die
6 REPLIES 6
Wieslaw Krajewski
Honored Contributor

Re: Verysimple Question

Hi,

Simply, you cannot change permissions of the symbolic links.
Not important because what we are interested in are just permissions to what symbolic link points.

Rgds.
Permanent training makes master
Shahul
Esteemed Contributor

Re: Verysimple Question


Hi Nitin

U can not the change permission of a symbolic link. U will have to change the permission of original file. But in case of hard link U can change the permission. In case of symbolic link inode numbers will be different. U can see this #ll -i linkname
But in case of hard link inode number will be same for both.

I n ur case it is symbolic link. So U can not change permission of link.


Shahul
dhanish
Regular Advisor

Re: Verysimple Question

Hi so u mean to say that in case of symbolic links the ultimate permissins which a user will get depends on the original file ..right???.Not depending on the permissinns of the link.Plus let me know that symbolic link ..i think can span across filesystems but the hard link cannot.and in case of hardlink as the inodes will be same so i can change the permisions on the link itself which in turn will effect the permissins of the orginal file....pls clarify my doubt
Never Say Die
Volker Borowski
Honored Contributor

Re: Verysimple Question

From "man chmod"
If chmod is used on a symbolic link,
the mode of the file referred to
by the link is changed.

So, you need to remove the link (!)
switch to owner/group where the link should belong to and set umask apropriate when you create the link.

777 is bad, because anybody would be able to delete your link due to write-permission.
Nevertheless, unlike hardlinks, diffrent inodes make it possible to have diffrent permissions:
-rwx------ 1 e30adm sapsys 0 Jun 25 13:54 a
lrwxrwxr-x 1 e30adm sapsys 1 Jun 25 13:54 b -> a

Volker
Ravi_8
Honored Contributor

Re: Verysimple Question

Hi,
there is no permissions to link as such.
Hard links are created with the same wnerships and permissions as the file or directory to which they are linked.If ownership or permissions are changed on a link or file, the same changes appear on corresponding hard links.The ln command does not permit hard links
to a directory.
Symbolic links are created with the ownership of the creator and the permissions are of the creator's current umask.Once created,the symbolic link ownership and permissions will not change, since the mode and ownership of the symbolic link is ignored by the system
never give up
nancy rippey
Trusted Contributor

Re: Verysimple Question

Just as reference you can change the owner and group of a symbolic link with 'chown -h filename' and 'chgp -h filename'
nrip