LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 09-02-2015, 10:28 AM   #1
linuxmantra
Member
 
Registered: Dec 2013
Posts: 104

Rep: Reputation: Disabled
File permission


I have created a FS /mybook and underneath I created a directory note
# cd /mybook/note
# touch test
total 0
-rw-r--r--. 1 root root 0 Sep 2 10:25 test
When I create a file 'test' under /mybook/note, file will have permission -rw-r--r--. What I need to do in Redhat Linux so that whenever I create a new file, i want to have a new file default permission as 775 or whatever I like. How can I do this.
 
Old 09-02-2015, 10:41 AM   #2
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Xubuntu, Manjaro
Posts: 745
Blog Entries: 3

Rep: Reputation: 347Reputation: 347Reputation: 347Reputation: 347
Quote:
Originally Posted by linuxmantra View Post
whenever I create a new file, i want to have a new file default permission as 775 or whatever I like. How can I do this.
Check this link on how to change the umask value:
http://www.cyberciti.biz/tips/unders...lue-usage.html
 
1 members found this post helpful.
Old 09-02-2015, 10:42 AM   #3
hortageno
Member
 
Registered: Aug 2015
Distribution: Ubuntu 14.04 LTS
Posts: 230

Rep: Reputation: 65
Quote:
Originally Posted by linuxmantra View Post
I have created a FS /mybook and underneath I created a directory note
# cd /mybook/note
# touch test
total 0
-rw-r--r--. 1 root root 0 Sep 2 10:25 test
When I create a file 'test' under /mybook/note, file will have permission -rw-r--r--. What I need to do in Redhat Linux so that whenever I create a new file, i want to have a new file default permission as 775 or whatever I like. How can I do this.
The question is, WHY do you need 755 for newly created files? Do you really need these files to be executable? Files not being executable by default is part of Linux's security model.

If you still need them executable read up on ACL.

Quote:
Originally Posted by HMW View Post
Check this link on how to change the umask value:
http://www.cyberciti.biz/tips/unders...lue-usage.html
That would affect permissions on all new files, not only in this folder.

Last edited by hortageno; 09-02-2015 at 10:43 AM.
 
Old 09-02-2015, 10:48 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by hortageno View Post
The question is, WHY do you need 755 for newly created files? Do you really need these files to be executable? Files not being executable by default is part of Linux's security model.

If you still need them executable read up on ACL.



That would affect permissions on all new files, not only in this folder.
True on affecting all new files... but it won't change the permissions on what is created UNLESS the creation includes modes. Most don't, so the most you get is "rw".

The bigger question is why are you using root for this?
 
Old 09-02-2015, 11:17 AM   #5
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Xubuntu, Manjaro
Posts: 745
Blog Entries: 3

Rep: Reputation: 347Reputation: 347Reputation: 347Reputation: 347
Quote:
Originally Posted by hortageno View Post

That would affect permissions on all new files, not only in this folder.
Ok. I thought that was the point. My bad.
 
Old 09-02-2015, 11:22 AM   #6
hortageno
Member
 
Registered: Aug 2015
Distribution: Ubuntu 14.04 LTS
Posts: 230

Rep: Reputation: 65
Quote:
Originally Posted by HMW View Post
Ok. I thought that was the point. My bad.
Reading the OP again, I'm not so sure anymore. ;-)

It would be interesting to know, what the OP wants to achieve...
 
  


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
[SOLVED] ext4 - permission to create/modify a file without 'delete' permission BeachHead Linux - General 4 06-08-2014 08:34 PM
File & Folder Permission and Ownership permission error in Cloud storage. rhcekumaran Linux - Newbie 3 06-14-2013 05:41 AM
[SOLVED] Apache 403 file permission error when accesing a symlink file (CentOS 6.3) mkvakic Linux - Newbie 7 02-13-2013 04:25 AM
Reading ext3 file system on Mac and overriding file permission moravveji Other *NIX 6 09-12-2011 03:25 AM
Any log file for checking file permission change history in RHEL 5.1? bilalcochin Linux - Newbie 3 04-02-2010 10:57 AM


All times are GMT -5. The time now is 04:30 PM.

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