LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 12-13-2007, 05:57 AM   #1
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Question 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
 
Old 12-14-2007, 01:03 AM   #2
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
this thread may be of some help
http://www.linuxquestions.org/questi...folder-605129/
 
Old 12-14-2007, 06:47 AM   #3
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
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
 
Old 12-14-2007, 10:11 AM   #4
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
I wasn't referring to that. Did you actually read the entire post? Look at the ACL section.
 
Old 12-16-2007, 05:37 PM   #5
mattydee
Member
 
Registered: Dec 2006
Location: Vancouver, BC
Distribution: Debian,Ubuntu,Slackware
Posts: 479

Rep: Reputation: 48
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.
 
Old 12-16-2007, 08:30 PM   #6
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
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?
 
Old 12-17-2007, 02:29 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
nothign to do with networking. moved to Linux - Newbie.
 
Old 12-17-2007, 03:07 AM   #8
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
Smile

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
 
Old 12-17-2007, 12:44 PM   #9
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
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
 
Old 12-17-2007, 03:03 PM   #10
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
missing folder permission, owner and group tritonw Linux - General 4 10-28-2007 11:21 PM
group creation + adding users without root permission rblampain Programming 5 05-12-2006 07:55 PM
Changing owner and group of file surfbass Linux - General 2 12-12-2005 02:25 PM
folder owner/group weird curos Slackware - Installation 1 07-18-2005 07:13 AM
How to change owner and group in a directory to include subdir and all files Lakota Linux - General 2 07-15-2004 09:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration