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 05-13-2009, 07:50 AM   #16
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Rep: Reputation: 51

I tried this from another normal user but its working
Code:
[jim@receiver Delta]$ touch jim-1
[jim@receiver Delta]$ ls -la
total 16
drwxrwsrwx   3 root root 4096 May 13 04:33 .
drwxr-xr-x  28 root root 4096 May 13 04:07 ..
-rw-rw-r--   1 jim  root    0 May 13 04:33 jim-1
drwxrwsrwx   3 root root 4096 May 13 04:27 projects
[jim@receiver Delta]$ cd projects/
[jim@receiver projects]$ touch jim-2
[jim@receiver projects]$
You said " Jim can create file under /Delta but not in /projects but its not like that.

Something to let you know, I ran chmod 2777 manually on /Delta and /projects one by one.

Info:
Code:
[root@receiver ~]# ls -la /Delta
total 16
drwxrwsrwx   3 root root 4096 May 13 04:33 .
drwxr-xr-x  28 root root 4096 May 13 04:07 ..
-rw-rw-r--   1 jim  root    0 May 13 04:33 jim-1
drwxrwsrwx   3 root root 4096 May 13 04:33 projects
[root@receiver ~]#
Code:
[jim@receiver Delta]$ ls -la
total 16
drwxrwsrwx   3 root root 4096 May 13 04:33 .
drwxr-xr-x  28 root root 4096 May 13 04:07 ..
-rw-rw-r--   1 jim  root    0 May 13 04:33 jim-1
drwxrwsrwx   3 root root 4096 May 13 04:33 projects
[jim@receiver Delta]$

Last edited by your_shadow03; 05-13-2009 at 07:52 AM.
 
Old 05-13-2009, 08:01 AM   #17
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
@your_shadow03:

Quote:
[jerry@receiver projects]$ cd /Delta/projects/
[jerry@receiver projects]$ cat test
hello I am user1 just edited this line
I am user2 ...Sounds working for setguid
Hi I am jerry outside this group
[jerry@receiver projects]$

How can she edit this since she is outside the group.
The permissions aren't set up correctly.

Take a look at the following:
Code:
$ ls -ld /Delta 
drwxrwsr-x 3 jade internet 4096 May 13 13:47 /Delta
Delta is owned by jade and group internet, it also has 2775 on the Delta dir.

druuna and jade are both member of the internet group,
cell_44 is not a member of the internet group.

With that in mind:
Code:
$ whoami
cell_44

$ id
uid=506(cell_44) gid=506(cell_44)

$ touch as.cell_44
touch: cannot touch `as.cell_44': Permission denied

$ cat in.delta
cat: in.delta: Permission denied

$ su - druuna
Password: 

$ id
uid=500(druuna) gid=500(internet)

$ cd /Delta/
$ touch as.druuna
$ cat in.delta

$ ls -l as.druuna in.delta 
-rw-r----- 1 druuna internet 0 May 13 13:54 as.druuna
-rw-r----- 1 jade   internet 0 May 13 13:32 in.delta

$ su - jade
Password:

$ id
uid=501(jade) gid=500(internet)

$ cd /Delta/
$ ls -l  as.druuna in.delta
-rw-r----- 1 druuna internet 0 May 13 13:54 as.druuna
-rw-r----- 1 jade   internet 0 May 13 13:32 in.delta

$ rm as.druuna in.delta
rm: remove write-protected regular empty file `as.druuna'? y

$ ls -l  as.druuna in.delta
ls: as.druuna: No such file or directory
ls: in.delta: No such file or directory
cell_44 is powerless and because of the 2775 on the Delta dir, jade is able to delete a file owned by druuna.


---Edit---
Quote:
You said " Jim can create file under /Delta but not in /projects but its not like that.
In your original example the projects dir did not have the correct permissions, which you noticed and changed while I was replying.

Last edited by druuna; 05-13-2009 at 08:03 AM.
 
Old 05-13-2009, 08:09 AM   #18
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Rep: Reputation: 51
Okie..What I mistaken is I created a directory by root user.

ROOT
Code:
#mkdir /Delta
That made it owned by root itself.
Correct?

Okie..I will modify it as:
[code]
#chown -R jade:internet /Delta
[code]
Is it correct?
 
Old 05-13-2009, 08:14 AM   #19
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by your_shadow03 View Post
Okie..What I mistaken is I created a directory by root user.

ROOT
Code:
#mkdir /Delta
That made it owned by root itself.
Correct?
Correct, I already stated this in reply #15

Quote:
Okie..I will modify it as:
Code:
#chown -R jade:internet /Delta
Is it correct?
Yes, that is correct. One small thing: The owner isn't that important (as long as it is a normal user), it is the group that is important (for this thread/example).
 
Old 05-13-2009, 08:32 AM   #20
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Rep: Reputation: 51
Thanks for making patience..
I appreciate your knowledge.
Great Man !!!
 
  


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
Creating a group home directory powerpleb Linux - Newbie 7 09-07-2012 01:42 AM
Group permisions on a directory ADxD_7 Solaris / OpenSolaris 7 04-08-2008 01:51 PM
Renaming group of files within one directory DIRdiver Linux - General 3 10-25-2006 10:57 AM
Sendmail Group Writable Directory flipcode Linux - Security 0 12-23-2004 04:41 PM
chmod for a group on a certain directory? mfeoli Linux - Newbie 1 02-10-2004 06:13 PM


All times are GMT -5. The time now is 10:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration