[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: retaining file permissions and ownership across sub-directories in Linux



Rishi napisał(a):
Hi

I'm not sure if this is the right forum for this question. If it is
not, I would be grateful to anyone that would be kind enough to point
to me appropriate forum so that I can take this query there instead.

I need to retain the same file permissions and ownership across
sub-directories in Linux.

I've got a 2nd hard disk (160 GB) and mounted in /vol1

I have 10 users and 2 groups on this system. These users access the
system from their disk less terminals (LTSP)...

Inside /vol1 I have created two folders
- sales
- finance

The two groups I have created on the system is sales and finance and a
few users belong to sales, a few to finance and a few to both.

I have set the owner of sales to "root:sales" and "root:finance" to
finance folders respectively.

The permissions on both folders are set to 775. However, when users
create files and folders within this folder the owners, groups and
permissions are not the same as the parent folder.

I was told by someone to do 'chmod ug+s sales finance' and that will
retain the permissions and user and group ownership as the parent
folders no matter which user logs in to save files within.

However, after trying that, I wasn't successful.

Any ideas on how to achieve what I'm trying to do?

Maybe there is another more obvious and simple way to do this and I'm
trying to do this in a very complicated way?

Any help would be great.

You seem to confuse two different things.
1. What are the current permissions (and ownerships) of the files and directories.
2. What the programs run by users do.

The first case is easily resolvable by right use of chown and/or chmod (I'll leave to you the reading of manuals for those two commands; I'll advise you to look for anything saying about applying the changes recursively)

The second matter is harder. You have some options tho.
You can try to set apropriate umask for your users. That's a good start. If it doesn't help, you can try to apply some acl-magic (AFAIR, there is a possibility to set up a default permission scheme for directory with ACLs)



Reply to: