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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-19-2007, 03:34 PM
|
#1
|
LQ Newbie
Registered: Jan 2006
Posts: 4
Rep:
|
HELP - Directory Permissions
Once I create a new user, I want him to only have access to 1 directory that I will create, I want him/her to have write and read access only.
Running Red Had Enterprise
I know I add a user - useradd and create a password, problem is I don't want this user to see anything else other that the one directory I want him to copy files to.
Last edited by desmondlewissmith; 11-19-2007 at 03:41 PM.
Reason: first was wrong
|
|
|
11-19-2007, 03:40 PM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Do the accounts already exist?
If yes, it's trivial:
Code:
for i in acc1 acc2 acc3 ... ; do mkdir $i; chown $i $i; chmod go-rwx $i; done
If you have a list of the names in a file it's even easier.
Code:
for i in `cat list` ; do mkdir $i; chown $i $i; chmod go-rwx $i; done
Cheers,
Tink
|
|
|
11-19-2007, 03:50 PM
|
#3
|
LQ Newbie
Registered: Jan 2006
Posts: 4
Original Poster
Rep:
|
Quote:
Originally Posted by Tinkster
Do the accounts already exist?
If yes, it's trivial:
Code:
for i in acc1 acc2 acc3 ... ; do mkdir $i; chown $i $i; chmod go-rwx $i; done
If you have a list of the names in a file it's even easier.
Code:
for i in `cat list` ; do mkdir $i; chown $i $i; chmod go-rwx $i; done
Cheers,
Tink
|
I messed this up, I went back and modified the question since it was written kinda wierd, now the answer doesn't make sense.. heelllllppppp... please...
|
|
|
11-19-2007, 04:01 PM
|
#4
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Quote:
Originally Posted by desmondlewissmith
I messed this up, I went back and modified the question since it was written kinda wierd, now the answer doesn't make sense.. heelllllppppp... please...
|
Heh. Strange things happen ;}
as for the new question:
I'm afraid that that request isn't very feasible. You can't trivially
lock users out of the entire file-system; you can stop them from
seeing each others files, though, which still works in the way I
described, just use their actual home directories.
|
|
|
11-19-2007, 04:08 PM
|
#5
|
LQ Newbie
Registered: Jan 2006
Posts: 4
Original Poster
Rep:
|
Quote:
Originally Posted by Tinkster
Heh. Strange things happen ;}
as for the new question:
I'm afraid that that request isn't very feasible. You can't trivially
lock users out of the entire file-system; you can stop them from
seeing each others files, though, which still works in the way I
described, just use their actual home directories.
|
Not sure how to read the reply you wrote, were the i's variables?
|
|
|
11-19-2007, 04:18 PM
|
#6
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Assuming that you have a list like
Code:
/home/user1
/home/user2
/home/user3
...
Code:
for i in `cat list` ; do chown -R $i $i; chmod -R go-rwx $i; done
Cheers,
Tink
|
|
|
All times are GMT -5. The time now is 04:56 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|