LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   HELP - Directory Permissions (https://www.linuxquestions.org/questions/linux-newbie-8/help-directory-permissions-600938/)

desmondlewissmith 11-19-2007 03:34 PM

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.

Tinkster 11-19-2007 03:40 PM

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

desmondlewissmith 11-19-2007 03:50 PM

Quote:

Originally Posted by Tinkster (Post 2964553)
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...

Tinkster 11-19-2007 04:01 PM

Quote:

Originally Posted by desmondlewissmith (Post 2964562)
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.

desmondlewissmith 11-19-2007 04:08 PM

Quote:

Originally Posted by Tinkster (Post 2964574)
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?

Tinkster 11-19-2007 04:18 PM

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:49 PM.