LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-06-2012, 12:47 PM   #1
acunacha
LQ Newbie
 
Registered: Nov 2012
Posts: 15

Rep: Reputation: Disabled
Setting separate default file and directory permissions


Hi,

This is a quick question, I have tried to find an answer but it's been unsuccesful.

Is there a way to set different default permissions for files and for directories?

To illustrate better, let's say I have a /project samba share. I want to configure that share so that new files created in it have the file permissions of 660, and new directories are created with 750.

I have thought of umask, acls, but I dont really know how to accomplish this.

Thanks in advance for your help.

Diego
 
Old 11-06-2012, 01:01 PM   #2
Larry James
Member
 
Registered: Jun 2000
Location: Buffalo, New York
Distribution: Ubuntu, Raspbian
Posts: 381

Rep: Reputation: 40
Quote:
Originally Posted by acunacha View Post
Hi,

This is a quick question, I have tried to find an answer but it's been unsuccesful.

Is there a way to set different default permissions for files and for directories?

To illustrate better, let's say I have a /project samba share. I want to configure that share so that new files created in it have the file permissions of 660, and new directories are created with 750.

I have thought of umask, acls, but I dont really know how to accomplish this.

Thanks in advance for your help.

Diego
Add this to your smb.conf share block:

Code:
# Mask for new files that are created;
  create mask = 0660

# mask for new directories that are created:
   directory mask = 0750
-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames
 
1 members found this post helpful.
Old 11-06-2012, 04:47 PM   #3
acunacha
LQ Newbie
 
Registered: Nov 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thank you very much Larry, that worked perfectly!

I really appreciate your help.

Diego
 
  


Reply



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
[SOLVED] Setting default permissions for new files under a directory sabresong Linux - Newbie 3 07-02-2012 07:16 PM
default directory and file permissions? c0pe Red Hat 1 07-19-2010 01:39 PM
Set default file/directory permissions replica88 Linux - Newbie 2 04-04-2010 10:12 AM
Default file and directory permissions Pinkks Linux - Newbie 5 02-17-2007 04:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:18 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
Open Source Consulting | Domain Registration