Changing permissions for all subdirectories and files

  • vish64
  • Novice
  • Novice
  • No Avatar
  • Joined: Jun 22, 2004
  • Posts: 23
  • Loc: USA
  • Status: Offline

Post September 23rd, 2004, 2:54 pm

Hi,

If I am the root user, how would I give a user access to all files and folders in a certain directory?

I tried chmod 'xxx' , but even with using 777, it only changes the directory permissions & not the files within it. Do i have to manually change permissions on every file ? whats the quickest way ?

Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 23rd, 2004, 2:54 pm

  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2675
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post September 23rd, 2004, 3:13 pm

vish64 wrote:
Hi,

If I am the root user, how would I give a user access to all files and folders in a certain directory?

I tried chmod 'xxx' , but even with using 777, it only changes the directory permissions & not the files within it. Do i have to manually change permissions on every file ? whats the quickest way ?

Thanks


Quickest?
chmod -R 777 dir_name/

Although, arbitrarily doing that is "bad" (TM). Giving everyone permissions to read, write and execute is NOT a good thing.

However, you did ask which was the quickest method, not the most appropriate.

BTW, should you have this sort of question regarding unix commands, try
man <unix_command> as in ;
man chmod

It will provide you with the manual page for that particular command.

Cheers.
"It's always a long day, 86,400 won't fit into a short."
  • Uncensored-Hosting
  • Proficient
  • Proficient
  • User avatar
  • Joined: Sep 26, 2004
  • Posts: 383
  • Loc: Los Angeles
  • Status: Offline

Post September 26th, 2004, 11:35 pm

Daemonguy is correct the -R makes it recursive and will affect all the files in the directory.
MONEY BACK GUARANTEE! • Ddos, DOS, Brute force, Password Trading & Proxy attack defense. • No price increase EVER!
sales@uncensored-hosting.com Uncensored-Hosting
  • mindcry
  • Novice
  • Novice
  • No Avatar
  • Joined: Sep 13, 2004
  • Posts: 34
  • Status: Offline

Post September 27th, 2004, 2:09 pm

If you want to just get directories try chmod -R 777 */
  • RGVsDigitalPimp
  • Born
  • Born
  • No Avatar
  • Joined: Jun 08, 2006
  • Posts: 2
  • Status: Offline

Post June 8th, 2006, 3:05 pm

Hey guys. Im a newbie with this Linux stuff but our Novell webserver crashed (hard drive) and thought to put Novells version (SUSE 10.0) instead. We have the root folder for our website at /etc/apache2/htdocs

We chmodded that folder and all subdirectories with you alls commads that you posted on here and seemed to work. I go in there, create a new folder in the root (i.e http://www.psja.k12.tx.us/purch) and when i try to access /purch on the site it says FORBIDDEN PERMISSION ERROR. I then have to chmod THAT folder to view it. Why do I have to chmod ALL folders one by one as i create them when i chmodded the root and all files and directories in there? Any ideas guys? Thanks in advance guys.
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2675
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post June 8th, 2006, 3:10 pm

It's called the umask.

Type
Code: [ Select ]
man umask
"It's always a long day, 86,400 won't fit into a short."
  • RGVsDigitalPimp
  • Born
  • Born
  • No Avatar
  • Joined: Jun 08, 2006
  • Posts: 2
  • Status: Offline

Post June 8th, 2006, 3:32 pm

Thanks for the quick reply but . . I think I got even more confused. Haha . . inversed numbers and all that with the umask command. I read the man umask and searched the net for umask explanations and found some but confused the heck out of me. We tried some umask commands that seemed to work but still getting permission denied forbidden errors. Hmmmm
  • Intruder BG
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 04, 2006
  • Posts: 13
  • Loc: Belgrade - City of Paviljoni
  • Status: Offline

Post July 4th, 2006, 8:24 am

I think it`s better to use .htaccess file to setting up permissions and lot`s of more stuff about your own site...
  • CodyRo
  • Beginner
  • Beginner
  • User avatar
  • Joined: Jul 03, 2006
  • Posts: 35
  • Loc: California
  • Status: Offline

Post July 4th, 2006, 1:30 pm

.htaccess is an apache function that will only affect people visiting the website, not the users on the machine.
  • Intruder BG
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 04, 2006
  • Posts: 13
  • Loc: Belgrade - City of Paviljoni
  • Status: Offline

Post July 4th, 2006, 1:34 pm

CodyRo wrote:
.htaccess is an apache function that will only affect people visiting the website, not the users on the machine.


Yeah sorry, I thought that he want to change permissions for website visitors :S My mistake...
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2675
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post July 5th, 2006, 5:43 am

RGVsDigitalPimp wrote:
Thanks for the quick reply but . . I think I got even more confused. Haha . . inversed numbers and all that with the umask command. I read the man umask and searched the net for umask explanations and found some but confused the heck out of me. We tried some umask commands that seemed to work but still getting permission denied forbidden errors. Hmmmm


I'm really not certain where the disconnect is regarding umask operations. It's merely an exclusive OR operation.

In Unix all base permissions begin as the following;
Directories [ Octal 777 / Binary 111111111 ]
Files [ Octal 666 / Binary 110110110 ]

Apply your umask as exclusive OR to any file created;

Umask = 022 (let's just say)

Create a new file named new.txt (touch new.txt).

It should be set with the following perms (barring the use of acl's and the like);

666 ^ 022 = 644, or 110110110 ^ 000010010 = 110100100,
Net result; rw-r--r--
"It's always a long day, 86,400 won't fit into a short."
  • PsyckBoy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jun 20, 2005
  • Posts: 204
  • Loc: SoCal
  • Status: Offline

Post July 13th, 2006, 10:19 am

Quote:
110110110 ^ 000010010 = 110010010


110110110 ^ 000010010 = 110100100
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2675
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post July 14th, 2006, 5:54 am

Good catch. Must have been a typo on my part. How embarrassing.
"It's always a long day, 86,400 won't fit into a short."
  • PsyckBoy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jun 20, 2005
  • Posts: 204
  • Loc: SoCal
  • Status: Offline

Post July 14th, 2006, 9:06 am

All those ones and zeros can start to run together
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2675
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post July 14th, 2006, 12:49 pm

Yeah but I am usually quite anal about that sort of thing. Sigh.
"It's always a long day, 86,400 won't fit into a short."
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 14th, 2006, 12:49 pm

Post Information

  • Total Posts in this topic: 15 posts
  • Users browsing this forum: No registered users and 63 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.