Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-13-2007, 06:57 AM
|
#1
|
Member
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518
Rep:
|
Change owner, group and permission settings on file and folder creation??
Hello,
I've got a system here were web developers can ftp into the web box and of course add change edit files. What i want to be able to do is automatically no matter which webdev user is logged in, to automatically when file and folders are added into the web root folder with permissions:
owner:apache
group:webdev
other:r-x
I would like all files and folders created to take on the same permissions as this, no matter what i do it seems the file always ends up being owned by the user that put it in place this is no good as i want apache to be the owner and webdev to be the group, this will then stop anyone in the webdev group from being able to change the permissions of the files and folders as they are not the owner of apache is the owner
Any ideas? SGID sets group fine so that done basically, but SUID doesn't set user as owner for anything created?? within the folder..
I'd want this to take place automatically and not via a script that runs every so often if i was going to do it that way i could do it myself, chown -R owner:group /folder
I hope this is possible, i'm using vsftp maybe i should try setting up virtual users??
Regards
|
|
|
12-14-2007, 02:03 AM
|
#2
|
Senior Member
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443
Rep:
|
|
|
|
12-14-2007, 07:47 AM
|
#3
|
Member
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518
Original Poster
Rep:
|
All they do at the end of it in that post is to SGID, i've already done that, the issue i'm having is to do a similar thing but with the username (or OWNER) of files and folders inside a directory. No its not as simple as SUID..
Regards
|
|
|
12-14-2007, 11:11 AM
|
#4
|
Senior Member
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443
Rep:
|
I wasn't referring to that. Did you actually read the entire post? Look at the ACL section.
|
|
|
12-16-2007, 06:37 PM
|
#5
|
Member
Registered: Dec 2006
Location: Vancouver, BC
Distribution: Debian,Ubuntu,Slackware
Posts: 479
Rep:
|
helptonewbie
Just out of curiosity, why do you trust users to delete the files but not change their permissions?
shadowsnipes, I'm not sure acl will do this since it takes care of permissions not ownership... you would think setting uid would do the trick... I've tried it also, but it doesn't seem to work.
|
|
|
12-16-2007, 09:30 PM
|
#6
|
Member
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835
Rep:
|
I would look into doing this through your ftp server's configuration. Which ftp server are you using? Have you read through the config file's documentation yet?
|
|
|
12-17-2007, 03:29 AM
|
#7
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
nothign to do with networking. moved to Linux - Newbie.
|
|
|
12-17-2007, 04:07 AM
|
#8
|
Member
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518
Original Poster
Rep:
|
Quote:
helptonewbie
Just out of curiosity, why do you trust users to delete the files but not change their permissions?
shadowsnipes, I'm not sure acl will do this since it takes care of permissions not ownership... you would think setting uid would do the trick... I've tried it also, but it doesn't seem to work.
|
Web dev's know how to make web files but most sure don't know much about permissions, its not that they may set them wrong although that is true also its that their ftp clients of which vary can set the permissions on the files once uploaded and this gets around that problem. Of which is now sorted taken ages to find what was required.
Yes i agree SUID thought would work but it does apparently on freeBSD!!
The first reason why i wasn't doing it through the ftp client was because the ftp clients method of umask settings wasn't working as a umask like expected which was abit useless, but found another parameter thats almost un-related that has fixed the issue.
Setting (vsftpd):-
file_open_mode=0777
local_umask=002
chmod_enable=NO
it was the file_open_mode that sorts out the issues with the umask problem, which then allowed me to use the chmod_enable no, so more or less sorted now to a point i can work with.
Regards
|
|
|
12-17-2007, 01:44 PM
|
#9
|
Member
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835
Rep:
|
That's where I'd suggest dealing with this problem. For the record, vsftpd is an ftp server, not an ftp client.
For a reference, use:
man vsftpd.conf
|
|
|
12-17-2007, 04:03 PM
|
#10
|
Member
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518
Original Poster
Rep:
|
i'm fully aware what vsftpd is i installed and set it up, just had an annoying problem which caused all this in the first place with the stupid way the umask doesn't work properly unless you use the:
file_open_mode=0777 but its not very well documented any where, or it took me ages to find that this would also be required so the umask would work how i wanted it to.
I'm talking about ftp clients because upon upload the clients where changing the file permissions on the file they uploaded to something useless, and i wanted to stop this and now i have
|
|
|
All times are GMT -5. The time now is 07:37 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|