www.mamboteam.com
macsat.com - OpenWrt | Olegs Firmware  
Home arrow Tutorials - OpenWrt (White Russian) arrow Samba Tutorial
Tuesday, 14 October 2008
 
 
Main Menu
Home
About
News
Tutorials - OpenWrt (WR)
Tutorials - Oleg
Wiki (RDC Based Routers)
Online Shop
Forum
Downloads
Free Linux eBooks
Links
Search
Contact Us
We have 1 guest online
2717224 Visitors
Login
Welcome Guest.






Lost Password?
No account yet? Register
Old macsat.com
Nokia Unlock (Dansk)
Nokia Unlock (English)
XBins IRC Chat
Samba Tutorial PDF Print E-mail
(2 votes)
Written by macsat   
Thursday, 24 November 2005
The Tutorial is made using a ASUS WL-500G Deluxe (or WL-500GX and WL-500GD as it is sometimes called).
It should however apply to all "OpenWRT Compatible" devices, even though some details like hardware addresses, storage locations and so on could differ if you use other hardware. Check out the General OpenWRT Tutorial Information page for more information.

This Tutorial aims at giving all users on the network a shared drive where they can Read and Write files, using the Linux implementation of Windows Networking - called Samba.

Samba offers a LOT of options, like shares owned by single users, groups of users and so on. It also offers printing capabilities through the linux printing system called Cups. All of this is however out of the scope of this Tutorial.
Users that wish to use more advanced features can consult the Official Samba homepage or take a look at some of the Samba/SMB howtos at The Linux Documentation Project homepage.


Tutorial Index

1. Prerequisites - What is needed to get started.
2. Installing and Configuring Samba

Prerequisites

All you need is :
  • An OpenWRT Compatible device
  • Extrenal storage like an USB Harddrive or USB Memory Stick or SD Card with some 50-100 MB space.(For the WL-HDD you just need a regular Harddrive)

  • The tutorial is based on you having mounted the external storage on /opt !

    Installing and Configuring Samba

    You should download the samba version from my downloads page:
     
     
    While nico does have one in his testing repository, it has a bug that triggers the following in the samba server log:
    kern.err smbd[11661]: Invalid packet length! (65600 bytes).
     
    On the windows side you will get errors like:
    Delayed Write Failed
     
    This bug is fixed in the version available from my downloads section, so I really recommend that you get that one. It will increase both stability and performance of your samba compared to the buggy one. 
     
    After downloading to somewhere (/tmp might be a good idea), do this : 
    ipkg install ./samba_2.0.10-1_mipsel.ipk

    Configuring is done easily by creating the file /etc/samba/smb.conf.
    An example of a (simple) working config file could be:
    workgroup = WORKGROUP
    server string = OpenWRT Samba Server
    wins support = no
    dns proxy = no
    name resolve order = lmhosts hosts bcast
    log file = /opt/var/log/samba/log.%m
    max log size = 1000
    syslog = 0
    security = share
    encrypt passwords = true
    obey pam restrictions = yes
    guest account = nobody
    passwd program = /usr/bin/passwd %u
    load printers = no

    [SambaShare]
    comment = /opt/samba
    path = /opt/samba
    browseable = yes
    public = yes
    guest ok = yes
    writeable = yes


    Now create the shared directory you defined in the config file, and make it writable by everyone.

    mkdir -p /opt/samba
    chmod 777 /opt/samba

    Now create a startup file called /etc/init.d/S50samba

    Mine looks like:
    #!/bin/sh

    case $1 in
    start)
    nmbd -D
    smbd -D
    ;;
    stop)
    killall nmbd
    killall smbd
    ;;
    *)
    echo "usage: $0 (start|stop)"
    exit 1
    esac

    exit $?

    Dont forget to make the file executable :
    chmod +x /etc/init.d/S50samba


    Now you can try to start your samba server:
    ps |grep "mbd"

    If your Samba server is running, this should give you something like:
    2170 root 908 S nmbd -D
    2172 root 924 S smbd -D
    2176 root 316 S grep mbd

    Now you should be able to browse your share called "SambaShare" from any computer that is a member of "WORKGROUP" (the default workgroup name in Windows).
    All users are able to both read and write on the share, since users all use the "nobody" account.


     


    I hope you found this tutorial useful.
    Comments and questions are welcome at the Support Forum

     

    Last Updated ( Thursday, 09 March 2006 )
     
    < Prev   Next >
    Buy Router
    Linksys WRT54GL
    Linksys WRT54GL
    Recent Forum Topics
    Donations

    If you appriciate this site, please consider making a small donation.

    All donations will be used to cover expenses from running macsat.com.

    Sponsored Ads
     
    Top! Top!