I just can make it readable, don't know how to make it writeable

path = /
create mask = 0755
valid user = myname
browsable = yes

P.S. what's the create mask ? and I'm using ubuntu server 11.0

  • 10
    Sharing the root of your filesystem of any operating system, Windows, Unix, Mac, BeOS.. is a huge security issue and could potentially cause problems later on. You're allowing anyone with the given username/password to spelunk the entire contents of the disk. Please re-consider what you're trying to do, and then allocate shares appropriately. – lazyPower Sep 8 '11 at 14:50
  • 2
    Writing to root (/) requires root privileges which is a bad idea for network services, especially in this case. Is there a particular reason why allowing write access to /home/youruser (or /var/www for that matters) is not enough? Keep in mind that even reading stuff as root allows users to read passwords from /etc/shadow. – Lekensteyn Sep 8 '11 at 15:00
  • 3
    @lazyPower Thanks. But I know what I'm doing, It's a testing box used to learning. – lovespring Sep 9 '11 at 3:22

By default, your Samba users are not going to have write access to the filesystem root. The easiest way to do this is to force a user. (Samba users will access the share using the local user's privileges.) Make sure that the user you specify has ownership and/or appropriate file system permissions. For ease of use in my example, I'm using root.

path = /
create mask = 0755
force user = root
browsable = yes

To answer your second question, the create mask is the default permissions that will be assigned to any file or directory created on the share by a Samba user.

| improve this answer | |

Here is a quick start on SMB2 with Samba 4.x . If you scroll down a little from that link, there is a section that gives a samba.conf example for an office share. Here is the smb.conf snippet:

# Global parameters
workgroup = MIDEARTH
netbios name = OLORIN
printcap name = cups
disable spoolss = Yes
show add printer wizard = No
printing = cups
comment = Home Directories
valid users = %S
read only = No
browseable = No
comment = Data
path = /export
force user = maryo
force group = users
read only = No

NOTE: Don't know if it matters, but keep in mind that Windows XP does not support SMB2 and so you may have some config variance here for computers that are using Windows XP or Macintoshes prior to this summers 'Mavericks' OSX release.

| improve this answer | |
  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – user98085 Jun 11 '13 at 22:06
  • Ok, I edited my answer. – djangofan Jun 13 '13 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.