Debian Squeeze Samba on NSLU2 SLUG External hard drive

Discussion in 'HOWTO-Related Questions' started by mykel, Oct 10, 2011.

  1. mykel

    mykel New Member

    To get SAMBA on my NSLU2, I followed the brilliant guide by Falko here:
    http://www.howtoforge.com/debian-squeeze-samba-standalone-server-with-tdbsam-backend

    The results or remaining issues:

    1. I can't get the user I added to login. It kept asking for user password.
    2. I can login to the server using details of the account created during Debian install and that will take me to my home directory where I can read and write files. But I can access the external USB HD from where I hope to share files, since the Debian install is on a USB stick.

    My SAMBA file points to the external HD as such: /media/usb0/shares/allusers
    I have entered the UUID of the external HD into fstab and pointing it to mount at the foregoing path.
    blkid lists the external hd
    fdisk -l also does
    It's formated ext3

    So the remaining big issues: how can I get SAMBA to see my external hd and getting the user created to be able to login.

    Below here, are output to different files, including SAMBA.CONF

    smb.conf
    [global]
    server string = %h server
    path = /media/usb0/shares/allusers
    obey pam restrictions = Yes
    pam password change = Yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword$
    unix password sync = Yes
    syslog = 0
    log file = /var/log/samba/log.%m
    max log size = 1000
    dns proxy = No
    panic action = /usr/share/samba/panic-action %d
    valid users = amer; lara
    security = user
    [homes]
    comment = Home Directories
    browseable = no
    valid users = %S
    writable = yes
    create mask = 0700
    directory mask = 0700
    [printers]
    comment = All Printers
    path = /var/spool/samba
    create mask = 0700
    printable = Yes
    browseable = No

    [print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers

    [media/usb0]
    comment = All Users
    path = /media/usb0/shares/allusers
    valid users = @users
    force group = users
    create mask = 0660
    directory mask = 0771
    writebale = yes

    fstab: And there's an "fstab.old" in /etc that does not have the last hd, which is the external hd that mounts at:/media/usb0/shares/allusers
    # /etc/fstab: static file system information. It simply has the first three lines.
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc defaults 0 0
    UUID=e84c39b2-601c-4811-bc8a-4c96ad39941f / ext3 errors=remount-ro 0 1
    UUID=dfc227c8-dcc5-4e2f-b6e3-dcc8a2b7b116 /boot ext2 defaults 0 2
    # /dev/sda5 none swap sw 0 0
    UUID=36182a75-94f3-4604-a515-7c2841cb7b17 none swap sw 0 0
    UUID=n2fcbff1-d98a-41a8-8e1c-2250bc6ce47e /media/usb0/shares/allusers ext3 0 0


    blkid output:
    /dev/sda1: UUID="dfc227c8-dcc5-4e2f-b6e3-dcc8a2b7b116" TYPE="ext2"
    /dev/sda2: UUID="e84c39b2-601c-4811-bc8a-4c96ad39941f" TYPE="ext3"
    /dev/sda5: TYPE="swap" UUID="36182a75-94f3-4604-a515-7c2841cb7b17"
    /dev/sdb1: UUID="b2fcbff1-d98a-41a8-8e1c-2250bc6ce47e" TYPE="ext3"

    pmount:
    /dev/disk/by-uuid/e84c39b2-601c-4811-bc8a-4c96ad39941f on / type ext3 (rw,relatime,errors=remount-ro,data=ordered)
    /dev/sda1 on /boot type ext2 (rw,relatime,errors=continue)
    /dev/sdb1 on /media/usb0 type ext3 (rw,sync,nodev,noexec,noatime,nodiratime,errors=continue,data=ordered)

    usbmount:
    no changes made to file, default options.

    Thanks in advance for your considered response.

    Cheers
     
    Last edited: Oct 10, 2011
  2. falko

    falko Super Moderator Howtoforge Staff

    Can you find any errors in your logs related to this?

    How did you create the user that is not able to login? Did you compare his entry in /etc/passwd with one from a user that is working?
     
  3. mykel

    mykel New Member

    Thanks a lot for your assistance.

    I will check the logs as regards the external usb.

    And as regards the user, I used #4 in your tutorial, "Adding And Managing Users". I used the entire content of that section. I was able to login to the system with the user created, but not to SAMBA.

    Cheers
     
  4. falko

    falko Super Moderator Howtoforge Staff

    You also used the smbpasswd command, right? Do you get any errors when you try to log into Samba?

    What's the output of
    Code:
    ls -la /media/usb0/shares/
    ? Maybe it is just a permissions problem.
     
  5. mykel

    mykel New Member

    Yes, I used the smbpasswd command.

    When I try to log into SAMBA, using credentials from the new user created, not the original system user created when I installed the OS, it kept asking me for the password.

    Here's the output of
    Code:
    ls -la /media/usb0/shares/
    drwxr-xr-x 3 root root 4096 Oct 6 02:14 .
    drwxr-xr-x 4 root root 4096 Oct 6 02:14 ..
    drwxrwxr-x 2 root users 4096 Oct 9 17:47 allusers

    I know it's a permission issue. Since this post was created, I've installed Webmin (very slow on this system but it works) And with Webmin, I can now access the external USB hard drive, but I can't write to it, regardless of the changes I've made to Webmin to allow write access. Perhaps if I make the changes directly to smb.conf, I can write to the drive. Below is the new smb.conf file created by Webmin:

    [global]
    log file = /var/log/samba/log.%m
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword$
    obey pam restrictions = Yes
    passwd program = /usr/bin/passwd %u
    dns proxy = No
    server string = %h server
    writeable = yes
    path = /media/usb0/shares/allusers
    unix password sync = Yes
    valid users = amer,lara
    syslog = 0
    security = user
    panic action = /usr/share/samba/panic-action %d
    max log size = 1000
    [homes]
    create mask = 0700
    directory mask = 0700
    comment = Home Directories
    writable = yes
    valid users = %S


    [printers]
    comment = All Printers
    path = /var/spool/samba
    create mask = 0700
    printable = Yes
    browseable = No

    [print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers



    [250gb]
    write list = amer,lara

    Many thanks again, for your considered help.
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Have you tried to set permissions as shown in the tutorial?

    Code:
    mkdir -p /media/usb0/shares/allusers
    chown -R root:users /media/usb0/shares/allusers/
    chmod -R ug+rwx,o+rx-w /media/usb0/shares/allusers/
     
  7. mykel

    mykel New Member

    Falko,

    Let me please thank you for your continued support on this. I followed the HowTo to the letter :) But I will go again and reissue these commands.

    Thanks a lot again.
     
  8. mykel

    mykel New Member

    I've just tried the last two line of codes and I still can't write to it. I rebooted just the NSLU after issuing those codes. I'm out of my wits on this one. Aside of uninstaling SAMBA and starting again, I really don't know what to do. If you however find the solution, well, a thousand good German beer.
     
  9. falko

    falko Super Moderator Howtoforge Staff

    I'm running out of ideas as well... :(
     

Share This Page