• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: permissions for samba to share usb drive with windows?  (Read 1269 times)
bad_gui
Jr. Member
**

Karma: 0
Posts: 50


View Profile
« on: November 23, 2010, 05:24:56 PM »

I have a microSD card and it was originally VFAT.  I was able to browse windows network
neighborhood and see files on /media/usb0.  I reformatted the microSD so that a user
account can download podcasts according to a cron job (didn't want root to do this).

Now I am unable to figure out samba settings to allow read access to the drive.  My desktop
linux box can't access LOCALDOMAIN so it is definitely a plug issue.  I don't want to log in
to the share just to read files.

Code:
[global]

        workgroup = localdomain
        server string = Samba Server Version

        netbios name = mywifiplug

        hosts allow = 192.168.1  127.

        log file = /var/log/samba/%m.log
        max log size = 50
        security = share
        passdb backend = tdbsam
        guest account = nobody
#       map to guest = bad user

        encrypt passwords = true
        socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65
536
        load printers = no
        printing = bsd
        printcap name = /dev/null
        show add printer wizard = no
        disable spoolss = yes

        local master = yes
        os level = 65
        domain master = yes

        deadtime = 1
        keepalive = 0

        log level = 3

        username map = /etc/samba/smbusers

[plug-storage]
        comment = The Wifi-Sheevaplug Storage
        path = /media
        public = yes
        writable = yes
        guest ok = yes
        create mask = 0777
        directory mask = 0777

Permissions on plug are:

guruplug:~# ls -l /media/
total 4
lrwxrwxrwx 1 root root    4 2010-04-06 06:55 usb -> usb0
drwxr-xr-x 4 root root 4096 2010-11-22 20:23 usb0

guruplug:~# ls -l /media/usb0/
total 20
drwx------ 2 root  root 16384 2010-11-22 20:22 lost+found
drwxr-xr-x 2 darkstar root  4096 2010-11-22 20:23 podcast


I have modified the original smb.conf based on web info so now it is a mess.  I'm also trying to share a
usb printer on the plug that is configured with cups.  There are many conflicting smb.conf tutorials on
the web.  Can someone share a working file?  Plug wiki is hacked and is useless right now.
Logged

bad_gui
Jr. Member
**

Karma: 0
Posts: 50


View Profile
« Reply #1 on: November 30, 2010, 06:31:16 PM »

I have looked at many samba tutorials and how-to s and was frustrated by the inconsistencies.

Two mistakes I made were that I forgot to change fstab stetting for the microSD from vfat to ext2
and I was using PyNeighborhood on my desktop linux box.  It turns out that PyNeighboorhood was
giving a mount error because /mnt/lan didn't exist not because of my smb.conf settings.  Embarrassed

Needless to say, now my desktop machine shows this

Code:
darkstar:$ smbclient -L mywifiplug -N
Domain=[MYWIFIPLUG] OS=[Unix] Server=[Samba 3.2.5]

        Sharename       Type      Comment
        ---------       ----      -------
        plug-storage    Disk      The Wifi-Sheevaplug Storage
        IPC$            IPC       IPC Service (Samba Server Version)
Domain=[MYWIFIPLUG] OS=[Unix] Server=[Samba 3.2.5]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
        LOCALDOMAIN          MYWIFIPLUG


Code:
darkstar:$ smbclient //192.168.1.100/plug-storage -N
Domain=[MYWIFIPLUG] OS=[Unix] Server=[Samba 3.2.5]
smb: \>

The problem now is that I can't list the share or see contents because of this error
Code:
smb: \> ls
Call returned zero bytes (EOF) listing \*
Error in dskattr: Call returned zero bytes (EOF)

Google turned up a french link describing the same problem and a fix
http://forums.fedora-fr.org/viewtopic.php?pid=165562
but I am not familiar with the /etc/nsswitch.conf file

On the guruplug, mine looks like this
Code:
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

Any ideas on [NOTFOUND=return]?  I don't see anything about that here
http://www.faqs.org/docs/securing/chap6sec71.html

Removing [NOTFOUND=return] from the nsswitch.conf fixed the error.
Logged

Pages: [1]
Print
Jump to: