You are not logged in.
Hi all,
I have a setup where some users access via SFTP a folder in their home which is symlinked to "/srv/http/somefolder/" my apache public folder.
I would like it that every new file created on this folder default with permissions 775 so that they are immediately reachable from the web. Now they default with permission 600. I would like only this folder default permissions to be affected.
I have researched about this and found about the "sticky bits" but from what I understood it has to do with the default "group" permission. What I'm looking for is for the "others" part of the permission.
Can anyone who knows, point me in the good direction or to some information that I could research on.
Thanks,
lio
Offline
"chmod" "chown"
https://wiki.archlinux.org/index.php/Chmod
http://publib.boulder.ibm.com/infocente … /chown.htm
Last edited by unilx (2011-02-07 07:05:32)
Offline
Google for "umask"
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Ok, thanks, I had ended on umask related explanations yesterday during my search. Now that I have the confirmation that this is how to achieve what I need, ill experiment with them.
Thank you again.
Offline
You can set the umask for the specified users, but I am not sure you can for specific directories using just the unix permissions. Two alternative options that should be considered:
ACL:
- Posix ACLs are supported by the Linux kernel, and I believe are installed by default in Arch (which actually surprised me a bit when I started using it...) The proposed standard was never actually ratified, but it is supported none the less. If you mount the filesystem that /srv/http/somefolder/ is on with the acl option (assuming that filesystem supports it, such as ext2/3/4 et al.) then you can set all files created to inherit permissions from a default ACL for the directory. Kind of a lot to learn about, but would certainly do what you want.
Scripts:
- It should be simple enough to create a script that will change all the permissions in a folder to have the permissions to desire... The trick is running it when needed. I believe there are programs that will hook into inotify and run whenever a filesystem event happens in a given directory, but I don't know off hand...
Offline