how to set permissions to softlink in linux

D_wathi
D_wathi used Ask the Experts™
on
Dear Experts:
Iam having a samba share where  all the lan users access for their work now we have started outsourcing the work to the home users (internet users) by creating one common user account and giving this account details to the internet users they login and take the work , untill now sysadmin use to copy the files to and from to the ftp account, now i am planning to create the softlink of the share to the user account where the internet users can direcly access the work,  this will save time and man power for copy and paste.

#ln -s /data/project1/10182010/   /home/outsource/
after executing the above command softlink 10182010 got created under the home directory of "outsource" user account when the user access it from the internet using the ftp client they are not able to browse the softlink directory.  Please suggest me should i give the permissions to the softlink directory like chmod -R 2755 or should i set the permissions to the orginal directory. please help me, thanks in advance.
Iam confused whether to give or should give the permissions to the softlink director or to the orginal share, if should give the permissions to the softlink then please tell me what permissions should i give. Please help.



Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2013
Top Expert 2013

Commented:
Hi,
a softlink has always 777. It's the permissions of the link target which are of relevance.
So modify the original share if needed and leave the softlink as is.
wmp

Author

Commented:
Sir, Thanks for the reply, as i have many groups hence used setfacl for the permissions , for your reference posted below the setfacl file.

# file: BT_AUDIO
# owner: root
# group: root
user::rwx
group::r-x
group:ntadmins:rwx
d:group:ntadmins:rwx
group:bttrans:r-x
d:group:bttrans:r-x
group:mttrans:r-x
d:group:mttrans:r-x
group:admin:rwx
d:group:admin:rwx
group:support:rwx
d:group:support:rwx
group:mt_qc:r-x
d:group:mt_qc:r-x
group:qa:r-x
d:group:qa:r-x
group:bt_qc:r-x
d:group:bt_qc:r-x
mask::rwx
d:mask::rwx
other::r-x
---------------------------------------------------------------------------------
i have also added the user to the bttrans group as bt trans group in the lan are able to access the share(as samba share) but the user from the internet through the ftp not able to cd to the softlink. please suggest me the steps to fix this. thanks
Most Valuable Expert 2013
Top Expert 2013
Commented:
Do you use chroot with the common account? With chroot it's not possible to follow a symbolic link pointing outside the chroot jail!
wmp

Author

Commented:
Sir, when uncommented the user from /etc/vsftpd/chroot_list then the user is able to cd or browse tot eh softlink directory but the problem is the user can even go to the /, etc and /home whcich i do not want this to happen . please help me
Most Valuable Expert 2013
Top Expert 2013

Commented:
Well, that's kind of a target conflict. You cannot have both, softlinks and chroot.
Maybe you could "mount" the directory inside the chroot directory instead of softlinking it.
Check "mount --bind ... " 
Here is a discussion about this method - http://aplawrence.com/Linux/mount_bind.html
and here is some more info -
http://lwn.net/Articles/159077/
"man mount" could help you too.
wmp

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial