Results 1 to 5 of 5
Alright so here's the question and I kind of need an answer pretty quickly (my boss is waiting hehe). Is there a way to change permssions on a directory and ...
- 05-09-2005 #1Just Joined!
- Join Date
- Apr 2005
- Posts
- 11
Permissions on a single user
Alright so here's the question and I kind of need an answer pretty quickly (my boss is waiting hehe). Is there a way to change permssions on a directory and all its files and subdirectories (-R?) to a specific user? I'm logged in as root.
Ex: I have a directory called dir1 and a user named mike. How do I give read permission to mike on dir1 and all of its subdirectories and files.
Plz help!
- 05-09-2005 #2Just Joined!
- Join Date
- Nov 2004
- Location
- Perth, Western Australia
- Posts
- 59
if you want to make him the owner of the folder and its contents, do
if you don't, you'll have to put him in a group and set the folder and it's contents to that group.Code:chown -R mike dir1/ chmod -R u+r dir1/
im pretty sure that by default, when you create a user, it creates a group with the same name with only that user in it, so if you want to use this group, you could do:
sorry if this post is too late to help, my clocks are all different times, so I don't know what the time is.Code:chown -R :mike dir1/ chmod -R g+r dir1/
EDIT: ok it looks like im over an hour too late...
- 05-09-2005 #3Just Joined!
- Join Date
- Apr 2005
- Posts
- 11
Can you explain that a little better. I'm a Unix and Linux nub. I don't want to make him the owner of the directory. He is only a temporary person and will be deleted in 2 weeks. I want to tkeep things as simple as possible. What is the default group when you first create a user? How can I change a user's group? How do I assign permssions to a certain group while being logged into root?
Can someone please answer this. I need an answer quick.
- 05-09-2005 #4Google.com is a great source especially for multiple questions like these.
Originally Posted by mike_1984
Also right there on your box you can type
for exampleCode:info chmod
or
or useradd...i get them mixed up!Code:man adduser
- 05-10-2005 #5Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
In your other (now locked, duplicate) thread, someone's reminded me
that Linux supports ACLs, which should achieve your aim. man setfacl should get you started.
Steve


Reply With Quote