LinuxQuestions.org
Help answer threads with 0 replies.
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 07-01-2009, 02:10 AM   #1
n_f
LQ Newbie
 
Registered: Jul 2005
Location: India
Posts: 23

Rep: Reputation: 15
Parent directory owner


Hi all

i have created a directory called "1" with the owner "apache" and group "user1".
user1 can access his home directory by ftp.
how user1 can create a sub-directory in directory "1" with the owner & group of directory "1"?

user1 can create sub-directory but with owner & group "user1".

thanks
 
Old 07-01-2009, 03:11 AM   #2
antegallya
Member
 
Registered: Jun 2008
Location: Belgium
Distribution: Debian
Posts: 109

Rep: Reputation: 42
Hello,

setuid and setgid on directory "1" (must be done with appropriate privileges ~ root will do it)
to put the setuid bit to 1 :
Code:
chmod u+s directory_1
for setgid :
Code:
chmod g+s directory_1
Regards

Last edited by antegallya; 07-01-2009 at 03:15 AM.
 
Old 07-04-2009, 08:57 AM   #3
n_f
LQ Newbie
 
Registered: Jul 2005
Location: India
Posts: 23

Original Poster
Rep: Reputation: 15
Thanks for your reply.

but when i create a sub-directory, it change the group but it does not change the owner of sub-directory.

am i wrong?
 
Old 07-04-2009, 11:04 AM   #4
antegallya
Member
 
Registered: Jun 2008
Location: Belgium
Distribution: Debian
Posts: 109

Rep: Reputation: 42
Hello,

you're right and I'm wrong, sorry.
In fact, the setuid bit on directorties is ignored on unix and linux. And it is not the case on freebsd where you can mount filesystems with the suiddir option that will allow that behavior.

If you really want to be able to do that without having to become root, you may make a little program that will change the ownership of files, with owner apache, the setuid bit set, group user1, read and execute flags on group and no read nor execute for other users.

I'm Sorry I couldn't help more.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Owner of a directory different than file owner problems Guardian-Mage Linux - Server 4 04-24-2009 11:26 AM
Goto Parent Directory anjanesh Linux - Newbie 6 01-03-2006 01:46 AM
'cp -rv .*' recurses into the parent directory??? stefanlasiewski SUSE / openSUSE 5 02-02-2005 06:36 PM
List only the parent directory scottrell Linux - General 6 11-07-2003 10:10 AM
mv the contents of one directory to the parent directory warkrime Linux - Newbie 4 07-14-2003 08:03 PM


All times are GMT -5. The time now is 06:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration