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
file:

    [global]
        ...
        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
file:

     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.

[global]
        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 = 192.168.1.255/WORKGROUP 192.168.1.208/WORKGROUP
        remote browse sync = 192.168.1.255
        wins support = Yes

        dns proxy = No
        valid users = nobody,root,wde,carlos,lincoln,nick
        create mask = 0777
        directory mask = 0777
        hosts allow = 127.0.0.1 192.168.27.0/24 192.168.16.0/24 192.168.2.0/24 192.168.4.0/24 192.168.8.0/24
        hosts deny = 0.0.0.0/0

[homes]
        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

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

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

Carlos

On Thu, 18 Aug 2005, Adam Zion wrote:

Date: Thu, 18 Aug 2005 19:07:31 -0400
From: Adam Zion <azion@cceb.med.upenn.edu>
Reply-To: Philadelphia Linux User's Group Discussion List
    <plug@lists.phillylinux.org>
To: plug@lists.phillylinux.org
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:

[Documents]
    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         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug


___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug