LinuxQuestions.org
Help answer threads with 0 replies.
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 10-31-2011, 06:33 PM   #1
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 201Reputation: 201Reputation: 201
chmod help


I have a large directory with about 60GB worth of subdirectories and files beneath it. I would like only root to have access to delete anything in that directory, while any user can read the files (say mp3's and I want any user to be able to play them). I keep thinking
Code:
chmod -R 644 /foo/bar
would give me read access to the files as a regular user, but it does not.

Since the directory in question is a subdirectory, do I need to give the same permissions all the way up the tree? is that where I'm making my mistake?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 10-31-2011, 06:37 PM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,970

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
Hi,

your mistake is that a directory must be executable in order to access it. You'll have to give 644 to all files but 755 to all directories.

Markus
 
3 members found this post helpful.
Old 10-31-2011, 06:38 PM   #3
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,218

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
If you want to traverse subdirectories you need something like
Code:
chmod -R u=rwX,go=rX /foo/bar
Capital "X" means: permision "x" only for directories.
 
6 members found this post helpful.
Old 11-02-2011, 07:53 PM   #4
oneyou
LQ Newbie
 
Registered: Oct 2011
Posts: 1

Rep: Reputation: Disabled
Hi

-rw-r--r--
user.group.all

First you need to changed the owner to root

chown -R root.root /foo/bar

then remove write access of other user

chmod -R 745 /foo/bar
7 means only root can read write or execute
4 groups can only read
5 all user can read and execute

I hope that will help
 
  


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
Sticky Bit? (ie: chmod 2770 vs chmod 770) JeffC1 Linux - Newbie 7 03-18-2010 07:39 AM
Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat? frenchn00b Programming 6 04-22-2009 01:10 PM
chmod 775 to only the directories and chmod 664 to only the files? apachenew Linux - Security 6 09-27-2007 03:26 PM
chmod, external usb, vfat - can't chmod a directory itsjustme Slackware 2 04-02-2006 04:23 PM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 05:37 AM


All times are GMT -5. The time now is 07:25 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration