LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 11-19-2007, 03:34 PM   #1
desmondlewissmith
LQ Newbie
 
Registered: Jan 2006
Posts: 4

Rep: Reputation: 0
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
 
Old 11-19-2007, 03:40 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 11-19-2007, 03:50 PM   #3
desmondlewissmith
LQ Newbie
 
Registered: Jan 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
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...
 
Old 11-19-2007, 04:01 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by desmondlewissmith View Post
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.
 
Old 11-19-2007, 04:08 PM   #5
desmondlewissmith
LQ Newbie
 
Registered: Jan 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
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?
 
Old 11-19-2007, 04:18 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Directory permissions focus1 Linux - Security 4 06-06-2006 04:09 PM
New directory permissions Paulsuk Linux - General 3 05-18-2005 06:36 AM
directory permissions Tinku Linux - General 9 09-25-2004 08:13 PM
directory permissions Tinku Linux - General 2 09-25-2004 11:25 AM
write permissions for directory - not accidently move/deleted the directory linuxgamer Linux - Newbie 10 12-02-2003 03:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration