LinuxQuestions.org
Review your favorite Linux distribution.
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 03-07-2010, 07:25 PM   #1
sloshymon
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Rep: Reputation: 0
Users and permissions


I am experimenting with users and there permissions ( I am a newer user) i have tried chown. and tried changing groups. still no luck, will anyone help me figure out how to... user1 and user2 have 3 directories d1, d2, d3, where u1 can read write in d1 and u2 can read write in d2. User2 can not read or write files in d1, and user1 cannot read or write in d2. and only those users can read or write those files??? thanks for any help.

root@ubuntu:/home/test/Desktop/test# chown u1 d1
root@ubuntu:/home/test/Desktop/test# chown u2 d2
root@ubuntu:/home/test/Desktop/test# ls -l
total 16
drwxr-x--- 2 u1 test 4096 2010-03-07 14:21 d1
drwxr-xr-x 2 u2 test 4096 2010-03-07 14:21 d2
drwxr-xr-x 2 test test 4096 2010-03-07 14:21 d3
-rwxr-xr-x 1 test test 476 2010-03-07 14:07 gnome-terminal.desktop
root@ubuntu:/home/test/Desktop/test#

i understand how to change groups.
 
Old 03-07-2010, 07:36 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,818

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
This looks a bit like a Homework project .
because this question was asked about a year or so ago . and there was a very lengthy discution on this
 
Old 03-07-2010, 07:38 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
What exactly is your qn; it sounds like you've got the std Linux setup; u1 can only rw their dir (d1), u2 can only rw their dir (d2).
If they are in the same group, then you can make the dirs have the same group so that they can share files.. what do you want to see?

for privacy, you'd want

drwx------ u1 test d1
drwx------ u2 test d2

to share home dirs


drwxrwx--- u1 test d1
drwxrwx--- u2 test d2

or a shared dir

drwxrwx--- test test shared_dir

http://linux.die.net/man/1/chmod

ownerships are user:group. Perms are user:groupther, each of which has rwx options.
 
Old 03-07-2010, 07:47 PM   #4
mattseanbachman
Member
 
Registered: Feb 2010
Posts: 40

Rep: Reputation: 15
Quote:
Originally Posted by sloshymon View Post
I am experimenting with users and there permissions ( I am a newer user) i have tried chown. and tried changing groups. still no luck, will anyone help me figure out how to... user1 and user2 have 3 directories d1, d2, d3, where u1 can read write in d1 and u2 can read write in d2. User2 can not read or write files in d1, and user1 cannot read or write in d2. and only those users can read or write those files??? thanks for any help.
Have you tried something like the following since the ownership of the directory has been changed already?

Code:
chmod 700 d1
chmod 700 d2
Then give it a try. Note I haven't tested this but it should work. Also, since someone else mentioned it, if it's a homework assignment, you're only cheating yourself by asking for the answers. Trust me.

Read up on file and directory permissions here: http://content.hccfl.edu/pollock/AUn...ermissions.htm
 
Old 03-07-2010, 08:05 PM   #5
sloshymon
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
I figured it out, yes this is homework but i am not procrastinating. I had o re read the chmod man pages. it was the chmod i was giving i was not ending up with the right permissions. thanks again for everyone who helped.
I was executing by group, 710,730,770, just trying to figure out how to add, understand commands quite well.(now i truly understand how to adjust permissions)

@mattseanbachman Thanks for the link will give it a read. and i have read it, My problem was more the chmod line itself.

Last edited by sloshymon; 03-07-2010 at 08:22 PM.
 
  


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
Groups..Users..Permissions.. kapilbajpai88 Linux - Newbie 8 02-23-2009 03:57 PM
Users and permissions draget Linux - Software 9 04-30-2006 06:56 AM
How to give permissions for users....... manikantha Linux - General 1 03-17-2005 05:27 AM
users/groups and permissions.... muman Linux - Newbie 2 09-21-2004 12:20 PM
my users permissions bacon22 Linux - General 2 01-20-2004 11:37 AM


All times are GMT -5. The time now is 06:58 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration