LinuxQuestions.org
Visit Jeremy's Blog.
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-2004, 05:15 AM   #1
mikemrh9
Member
 
Registered: Nov 2003
Distribution: Arch
Posts: 136

Rep: Reputation: 21
Understanding chmod, chown


Hi. I'm currently trying to get my head around file permissions.

As I understand it, if I apply 'chmod g+rs' to a directory, what should happen is that 'r' allows the group to read all files in the directory and 's' allows the group to access the contents of the directory, like 'x'. This bit is fine. However, 's' is also supposed to force all files in the directory to the same group as the directory, which is the bit giving me trouble.

I created a directory, dir1, and put some files into it (file1, file2 etc). I changed the ownership of the files with chown :group1 *

At this point, the ownership of dir1 is user1, users. The ownership of all files in the directory is user1, group1.

If I now do chmod g+s dir1, the group permissions to dir1 are changed to r-s, but the files in dir1 are unaffected. I assume I have misunderstood the phrase, ' force all files in the directory to the same group as the directory'.

What is it that 's' does when applied to a directory for a group?

Mike.
 
Old 11-19-2004, 06:01 AM   #2
z-vet
Member
 
Registered: Aug 2004
Location: Israel
Distribution: LMDE 5
Posts: 271

Rep: Reputation: 34
Try
Code:
chmod -R g+s dir1
-R is recursive.
Code:
man chmod
is the best way to understand it.
 
Old 11-19-2004, 06:02 AM   #3
Nightblade_oz
LQ Newbie
 
Registered: Aug 2003
Location: Australia
Distribution: Fedora Core 2
Posts: 24

Rep: Reputation: 15
AFAIK, 's' is for *new* files created in that dir. If you want to change existing files, use -R like the other poster said.
 
Old 11-19-2004, 07:38 AM   #4
mikemrh9
Member
 
Registered: Nov 2003
Distribution: Arch
Posts: 136

Original Poster
Rep: Reputation: 21
Thank you.
 
Old 11-19-2004, 03:27 PM   #5
rockets
LQ Newbie
 
Registered: Oct 2004
Location: Lillian, Alabama , USA
Distribution: mepis8, debian lenny
Posts: 23

Rep: Reputation: 15
Here is a link for a turorial on chmod. I made a linux utilities directory in my home dir and downloaded it so I can practice without damage.

http://catcode.com/teachmod/index.html
 
  


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
chmod/chown and folders :) chibi Linux - Newbie 2 04-28-2005 04:56 PM
Chown & Chmod swatward Linux - Newbie 2 03-01-2005 12:57 PM
chmod ,chown ,chgrp------------ pal Linux - Newbie 1 02-27-2005 02:49 PM
Log Chmod and Chown FernandoLozano Linux - Security 5 01-10-2005 09:01 AM
reverse chmod/chown changes demmylls Linux - General 1 02-09-2004 12:16 AM

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

All times are GMT -5. The time now is 09:19 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