LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-04-2018, 03:16 PM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post A file or folder with two owner or group.


Hello.
Can I set two owner for a file or folder? How about group?

Thank you.
 
Old 12-04-2018, 03:22 PM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
No, a file can only have one owner and one group, but you can allow other users/group members to access a file using ACLs.
man setfacl and man 5 acl for details.


Using them is a bit clunky however.
 
Old 12-04-2018, 03:24 PM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by hack3rcon View Post
Hello.
Can I set two owner for a file or folder? How about group?

Thank you.
I'm gonna say no.

You can, however have two users in a group and set the group permissions on a file or folder to be rw.
That would allow both users to have read-write access to the file/folder. See man chmod or enter
linux permissions
into your favorite search engine.
 
Old 12-04-2018, 10:56 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
2 people in same group is the usual way - see chmod/chown/chgrp .
 
Old 12-05-2018, 02:18 AM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by chrism01 View Post
2 people in same group is the usual way - see chmod/chown/chgrp .
Plus the SetGUID bit for the group.
 
Old 12-05-2018, 07:50 AM   #6
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
The setGUID isn't normally required.
 
Old 12-05-2018, 07:53 AM   #7
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by JeremyBoden View Post
The setGUID isn't normally required.
It's needed so that new files get the right group settings, but is also affected by the general umask. Otherwise the file will end up owned by one and while maybe readable by the others not editable by them.
 
2 members found this post helpful.
Old 12-06-2018, 03:29 PM   #8
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
I did "setfacl" with "-R" option but I guess user can delete some files and directories.
 
Old 12-06-2018, 03:48 PM   #9
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
OK. Again.
We're answering your questions, but the answers don't seem to be solving your problem.
That would be because we don't know what you're trying to do.

Please tell us that. I'm sure we can help, but this nickle-and-dime dialog is both tedious and non-productive.
 
3 members found this post helpful.
  


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
change of owner and group owner of a file belongs to diff user ? somorg Linux - Newbie 3 06-14-2015 09:11 AM
change of owner and group owner of a file belongs to diff user ? somorg Linux - Security 2 06-13-2015 02:33 AM
change of owner and group owner of a file belongs to diff user ? somorg Linux - General 2 06-12-2015 10:40 AM

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

All times are GMT -5. The time now is 04:09 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