Carlos Konstanski on 19 Aug 2005 00:31:48 -0000

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Problems mounting linux samba share as read-write *from* a linux box

There may be more to the story of samba access than file permissions.
Samba has its own idea of users.  You need to set this up.

Start by adding this line to the [global] section of your smb.conf

        encrypt passwords = Yes
        valid users = nobody,root,<your-users>

This sets up the user permissions mechanism in samba.  Now you need to
define all these users in 2 files: smbusers and smbpasswd.  Both live
in the same directory as smb.conf (probably /etc/samba/).

smbusers gets edited by hand.  It is a list of users, one per line,
with all aliases listed after the "=" sign.  Example:

     nobody = nobody guest pcguest smbguest
     root = root
     carlos = carlos
     wde = wde
     lincoln = lincoln
     nick = nick

This is a complete, legal smbusers file.

smbpasswd is different.  You use this command to write entries in this

     smbpasswd -a <username>

An NT-style encrypted password gets written to smbpasswd for the user
when this command is executed and a password is entered (twice) at the
prompt.  This makes it compatible with winblows.

Then restart samba with:

     /etc/init.d/samba restart

See if this changes anything for you.


Just for the sake of completeness, here's a smb.conf file from a samba
server on a big network that is known to work.  It is the master
browser, the domain master, everything.  You can do without the
"remote announce" and "remote browse sync" entry.

        workgroup = WORKGROUP
        netbios name = HAL
        server string = Samba Server on HAL
        encrypt passwords = Yes
        map to guest = Bad User
        password level = 8
        username level = 5
        log level = 2
        max log size = 0
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

        os level = 99
        preferred master = Yes
        domain master = Yes
        local master = Yes
        enhanced browsing = Yes
        remote announce =
        remote browse sync =
        wins support = Yes

        dns proxy = No
        valid users = nobody,root,wde,carlos,lincoln,nick
        create mask = 0777
        directory mask = 0777
        hosts allow =
        hosts deny =

        comment = Home Directories
        valid users = %S
        read only = No
        create mask = 0755
        force create mode = 0755
        security mask = 0755
        directory mask = 0755
        directory security mask = 0755
        inherit permissions = Yes

        comment = All Printers
        path = /var/spool/samba
        guest ok = Yes
        printable = Yes
        browseable = No

        comment = Public share on HAL
        path = /var/samba
        read only = No
        force create mode = 0777
        guest ok = Yes


On Thu, 18 Aug 2005, Adam Zion wrote:

Date: Thu, 18 Aug 2005 19:07:31 -0400
From: Adam Zion <>
Reply-To: Philadelphia Linux User's Group Discussion List
Subject: [PLUG] Problems mounting linux samba share as read-write *from* a
    linux box

I have two Mandrake linux boxes, one named Calvin, and the other Hobbes. The share is defined on Calvin as the following:

    comment = Adam's Documents
    path = /home/adam/Documents
    browseable = yes
    writeable = yes
    read only = no
    valid users = adam
    directory mask = 0777

All files set in the directory /home/adam/Documents are set at 777, owned by the user and group adam. When I mount this share from Hobbes, using the following command:

mount -t smbfs //calvin/Documents /mnt/calvin -o username=adam,password=*

After I do this, I have read-only permission when logged onto Hobbes as adam, but write permission when I su in as root. When I check ownership of all the files and directories in this directory (while logged onto Hobbes), ls -la tells me that root owns all the files, hence my inability to write to them as adam.

Any idea why mount is changing the effective permissions on this share? What concept am I missing here? User adam on Hobbes needs read-write access to this directory (the idea is that this Calvin is my NAS box). User adam exists as a samba user on Calvin, with the same password as I use for the same user on Hobbes.


Adam Zion, MCSE+I
IT Support Specialist Senior
Center for Clinical Epidemiology and Biostatistics
Blockley Hall 103D

Borger King: Have it our way. Yours is irrelevant.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --