LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 07-28-2004, 01:21 PM   #1
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Rep: Reputation: 15
Permissions of new folders through samba


We use samba at work to share files from a server machine to machines running Linux and Windows. It works great but if a user creates a new folder, they cannot then write to it without someone sshing into the server and changing the folders permissions.

Can anyone tell me how to configure samba to allow users to write to directories that they have created?
 
Old 07-28-2004, 07:49 PM   #2
jhumeston
Member
 
Registered: Mar 2004
Posts: 50

Rep: Reputation: 15
in your smb.conf file, add this line under the share section:
create mask = 0765 (or whatever mask you want)
 
Old 07-29-2004, 02:03 AM   #3
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Original Poster
Rep: Reputation: 15
How do I know what mask I want? and what am I tellling it to do?
 
Old 07-29-2004, 11:21 AM   #4
jhumeston
Member
 
Registered: Mar 2004
Posts: 50

Rep: Reputation: 15
the mask is a octal 3bit setting where it has the opposite effect of chmod permissions. If you do a chmod 777 then it gives rwx, in a mask if you set it to 777 then it removes all three (like a chmod 000). If you set your mask to 222, then it effectivly gives a chmod 555. You will probably want to tinker with it a while to get it the way you want.
 
Old 07-29-2004, 02:38 PM   #5
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Original Poster
Rep: Reputation: 15
Thanks for the help. But I'm still struggling.

I've edited /etc/samba/smb.conf. I picked a share and added create mask = 0000 (figuring this would act like doing a chmod 777). I restarted samba and from a remote machine created a folder, moved into the folder and tried to create a text document and got the error "Access Denied, could not write to .................".

Have a done something wrong should there be a section labelled "share" or do you put the line into the individual shares?
 
Old 07-29-2004, 03:32 PM   #6
jhumeston
Member
 
Registered: Mar 2004
Posts: 50

Rep: Reputation: 15
put it into the individual shares. Take a look at the actual folder that was created. do an ls -l and it will show you the permissions on the folder.

[user1]
your config here
create mask = 0000

[user2]
your config here
create mask = 0000
 
Old 07-30-2004, 02:02 AM   #7
kenji1903
Member
 
Registered: Apr 2004
Location: M'sia, Aus, Chn
Distribution: Redhat Linux 8 & 9, Fedora Core 2, XP
Posts: 301

Rep: Reputation: 30
Sorry to interrupt you guys~

Here is the portion of my smb.conf that enables roaming profiles:
Code:
[proflies]
path = /home/samba/profiles
writeable = yes
browseable = no
create mask = 0600
directory mask = 0700
profile acls = yes
What are the masks for? SInce i was working fine so i did not bother to understand what is does, mind explaning a bit?
 
Old 08-02-2004, 09:05 AM   #8
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Original Poster
Rep: Reputation: 15
These are the permissions of the folder I created. With no mask added to smb.conf.

drwxr-xr-x 1 nobody nogroup 0 2004-08-02 13:48 New Folder_3

Then I added this create mask line to my smb.conf file and restated samba:

[reception]
create mask = 0000
comment = Shelter Reception Folders
path = /home/media/My Documents (Networked)/Reception/
read only = No
guest ok = Yes

This is the result:

drwxr-xr-x 1 nobody nogroup 0 2004-08-02 14:03 New Folder

Exactly the same - what am I doing wrong?
 
Old 08-02-2004, 10:26 AM   #9
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Original Poster
Rep: Reputation: 15
Hmmmmmmmmmmm, I just noticed something else weird. If I create a folder on the samba share as root I can write to it but I get this error if I try to delete it (even though it cannot be busy as all I have done is create it an try to delete it immediately):

mainbox:/mnt/reception# mkdir Test
mainbox:/mnt/reception# rm Test/ -fr
rm: cannot remove directory `Test/': Device or resource busy
mainbox:/mnt/reception# exit
 
Old 08-10-2004, 01:46 AM   #10
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Original Poster
Rep: Reputation: 15
Defining a guest account

I'm sorted now (I hope). The problem was that I hadn't specified a guest account. I've now added "guest account = <<UserName>>" to my smb.conf. Changed all the files in the share to be owned by that user and it all seems to be working OK.
 
  


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
write permissions on certain folders PensJunkie Linux - General 4 06-20-2005 08:17 PM
Settign permissions on folders reddog64 Linux - Newbie 3 04-19-2004 03:23 PM
files&folders permissions under SAMBA share shani Linux - Software 2 11-20-2003 12:48 PM
Permissions for folders geolew Red Hat 4 09-03-2003 10:49 PM
Permissions with windoze folders sportjeep99 Linux - General 1 06-07-2001 11:07 PM


All times are GMT -5. The time now is 08:00 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration