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 04-04-2010, 10:00 AM   #1
replica88
Member
 
Registered: Nov 2009
Posts: 48

Rep: Reputation: 18
Set default file/directory permissions


I want to set the default file and directory permissions for anything created within a specific folder.

For example I have a directory at /test and I want any directory's then created inside /test to have permissions automatically set to 0777

I know that "chmod -R 777 /test" will change the permissions that exist at that time but it does not apply to any future directory's that are created.

Can somebody help me out with the correct command please?

Many Thanks
 
Old 04-04-2010, 10:09 AM   #2
fuorviatos
Member
 
Registered: Nov 2009
Location: Italy actually
Distribution: Ubuntu 9.10, Fedora 12, Free BSD
Posts: 33

Rep: Reputation: 16
Quote:
I know that "chmod -R 777 /test" will change the permissions that exist at that time but it does not apply to any future directory's that are created.
I suppose that is a linux bult-in security policy as you're creating this folder within the filesystem so it's only permitted to the root user.
If you try to change the owner of the folder to the user to a normal one? Or you must access it as root?
 
Old 04-04-2010, 10:12 AM   #3
isra
Member
 
Registered: Jan 2006
Location: Mexico, city
Distribution: DEBIAN, OpenSolaris
Posts: 32

Rep: Reputation: 15
try de umask
umask sets the default permissions. We have 2 options. For the entire system or in a per-user basis. and this depends on the shell for bash:
for the per-user basis:
$HOME/.profile
and for the entire system:
/etc/profile

more info

man bash
 
  


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
Default directory and file permissions kodon Slackware 12 02-13-2020 01:49 PM
Default file and directory permissions Pinkks Linux - Newbie 5 02-17-2007 04:06 PM
Can I set default file/directory permission levels? toes Linux - Security 5 01-05-2007 06:21 PM
Where to set default file permissions (umask)? tredegar Linux - Newbie 14 01-27-2004 05:10 PM
How to set correct file/directory permissions pat.delaney Linux - Networking 5 12-02-2003 09:39 AM

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

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