User home folder permissions catch-22, help!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers User home folder permissions catch-22, help!
# 1  
Old 07-16-2007
User home folder permissions catch-22, help!

Hi everyone.

My objective is to configure a Solaris 10 box as follows: There will be many simultaneous users connecting to it, and each of those users would automatically get a home folder.

For example, when I add user "Bob", the home folder would be /export/home/Bob
And for Mary, it's /export/home/Mary

Each user is member of group "users".

Now the objective is that each user should have full control over his or her own home folder, but must NOT be able to do anything (or even visit) other people's home folders. Furthermore, the requirement is that users should NOT be able to change the permissions on their own home folder to allow this to happen. In other words, Bob must NOT be able to allow Mary access to his home folder, even if he wants to.

(Please don't ask me why he would want to do so or why users shouldn't be able to do so -- it'll suffice to say I'm setting up a school system and the users are students).

I have a boolean choice here: Either I make the user the owner (via chown) of their home folder, or I don't.

If I do make them owner (e.g. user Bob owns folder /export/home/Bob), then, sure, I can change the folder permission on /export/home/Bob to 700, and only Bob is able to do anything in it. But nothing stops Bob from running "chown 777 Bob" from the /export/home folder, and voila, other people can go there again"

If I do NOT make users owners of their folder (e.g. someone other than Bob, say Admin, owns all user folders, including /export/home/Bob), then I have no way to EXCLUSIVELY allow Bob permission to work in his folder. Unlike Windows (where you can give permission to a specific user), in Unix permissions only range by owner-group-everyone. Since Bob is not the owner, permitting either nobody or just the owner access to /export/home/Bob will not allow Bob to work in his own folder. If I do the permission by group (say the "users" group that Bob is part of), then all other people in group "users" (like Mary) will be able to open that folder. And allowing everyone access doesn't work for obvious reasons.

So it seems that whatever my choice, I cannot simulatenously allow exclusive access to a particular user WITHOUT letting that user to change the fact the access is actually exclusive.

In my search for solutions, I came up with the absolutely bizzare, poor practice, and overcomplicated option (Rube Goldberg would be proud) that right now nevertheless seems to me as the only one to accomplish my goals. The option requires the following algorithm:

1. Whenever you create a user, a group is created just for that user (for Bob it's BobGroup, for Mary it's MaryGroup... And so on. 100 users = 100 groups).
3. User is made member of that group, while retaining his membership in the "users" group as well.
2. A clone user (or as I call him, a Guardian User) is created. For Bob, it's BobGuardian, for Mary, it's MaryGuardian. 100 users = 100 extra guardian users). That guardian user is member of the 2-man group (BobGuardian will be member of BobGroup), but NOT of the "users" group.
3. The real user's folder ownership is moved to the guardian user, and the ownership group is the 2-man group. E.g. /export/home/Bob's owner is BobGuardian, not Bob, and the ownership group is set to BobGroup for that folder (chown BobGuardian:BobGroup /export/home/Bob)
4. The user's home folder's permissions are set to 770.
5. The Guardian user is password protected by the sysadmin and the real user never gets control over it.

As a result, Bob (being a member of the BobGroup), has full permissions to the inside of his home folder (can create stuff in it, read and execute) by virtue of being in the group which is the owner group of /export/home/Bob, but has no OWNERSHIP of the folder, and therefore cannot change the folder permissions to allow other users access to that folder.

I know the system is an absolute mess and something you'd see as an example of a "Why I quit my job" topic. But as I said previously, I don't see any other way. I'd be very happy to know if I'm wrong and there is actually a way that would NOT cause permanent brain damage to those who know how it works. Please let me know!
# 2  
Old 07-16-2007
Code:
setfacl -s user::rwx,group::---,mask:---,other:--- /export/home/*

# 3  
Old 07-16-2007
Thanks for the reply, can you please describe more specifically what each part of the command does?
# 4  
Old 07-17-2007
From man "setfacl" :
Quote:
-s acl_entries Sets a file's ACL. All old ACL entries are
removed and replaced with the newly speci-
fied ACL. The entries need not be in any
specific order. They will be sorted by the
command before being applied to the file.

Required entries:


o Exactly one user entry specified for
the file owner.

o Exactly one group entry for the file
group owner.

o Exactly one other entry specified.

If there are additional user and group
entries:


o Exactly one mask entry specified for
the ACL mask that indicates the maximum
permissions allowed for users (other
than the owner) and groups.

o Must not be duplicate user entries with
the same uid.

o
HTH
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Permissions on a directory in /home for all users

Hi, I have created a shared directory on /home, where all users on a certain group have read, write and execute permissions. I did this using chmod -R g+rwx /home/shared/ The problem is, when a particular user creates a directory within /home/shared, other users are not able to write to... (8 Replies)
Discussion started by: lost.identity
8 Replies

2. Ubuntu

Folder permissions

Hi Team, I want to set permissions to one folder in such a way that the user can write files or create folder inside that but should not able to delete it. Basically reason behind this is i am using Pidgin Messenger. There is a directory of logs in which, when user chat its store his logs.... (2 Replies)
Discussion started by: paragnehete
2 Replies

3. Red Hat

Need to compare two folder / FS permissions

Hi, Need to compare two folders / File systems permissions & time stamps including sub folders and files. Kindly let me know if any commands available. Regards :: VM (1 Reply)
Discussion started by: novaothers
1 Replies

4. UNIX for Advanced & Expert Users

Keeping your Home file permissions correct

I have been a UNIX user for a long time, and in that time I have been looking for a program to set/reset all the file permissions of a complex directory hierarchy (my home) according to a configuration file of rules. That is not the simple find-xargs-chmod rule but a program (shell/perl/c)... (4 Replies)
Discussion started by: antofthy
4 Replies

5. Solaris

how to change /export/home/user dir to /home /user in solaris

Hi all i am using solaris 10, i am creating user with useradd -d/home/user -m -s /bin/sh user user is created with in the following path /export/home/user (auto mount) i need the user to be created like this (/home as default home directory ) useradd -d /home/user -m -s /bin/sh... (2 Replies)
Discussion started by: kalyankalyan
2 Replies

6. UNIX for Advanced & Expert Users

Home Directory Permissions

My users home directory located in a RHEL 5.0 nfs server. Client is ubuntu 8.1 using NIS for authntication anf NFS for automounting home Directory on the client side. I set 700 to the users home directory. My problem here is some of the users change the mode, which result in leak of... (2 Replies)
Discussion started by: a_artha
2 Replies

7. Shell Programming and Scripting

Batch delete specific folder from user home directories

Hi! Need your help. How can I delete the cache folder of multiple user home directories via automatically executed shell script on a Mac OS X Server? Example: The userdata are stored on a Xsan Volume like this: /Volumes/Xsan/userdata/mike /Volumes/Xsan/userdata/peter... (2 Replies)
Discussion started by: nipodrom
2 Replies

8. Windows & DOS: Issues & Discussions

folder permissions

I work for a big company and all the people within my unit share a common drive to save documents to. I am listed in the group(AMS group) that has access rights to folders within this drive. but i'm trying to restrict access to a confidential folder so that only I can access it. when I set the... (0 Replies)
Discussion started by: shed
0 Replies

9. UNIX for Dummies Questions & Answers

Can I prevent a user from changing the permissions on their home directory.

Hello All, I have a new HPUX system going into production and it will be used by 2 projects. One of the contract requirements is the 2 groups can not have access to the others work or data. I believe I have the system pretty well locked up using groups and permissions and selective mounting of... (2 Replies)
Discussion started by: DanL
2 Replies

10. UNIX for Dummies Questions & Answers

Reset Home Directory Permissions

I accidently reset the permissions of my /home/punkrockguy318 directory to root only. How can I get my punkrockguy318 permissions ( and all of it's contents) to be read/write accesable only to punkrockguy318 and root? (5 Replies)
Discussion started by: punkrockguy318
5 Replies
Login or Register to Ask a Question