Web Projects Outsourcing

Setting Up Samba

Objective: create a rather simplistic samba share for a small office or home network.

I started from these articles:

  1. You do not need swat, it is rather awkward and confusing, imho.
    sudo yum install samba
    
  2. With Administration -> Users and Groups, check that your user belongs to “users” group.
    sudo mkdir -p /home/shares/allusers
    
  3. Open ports on firewall: 137,138,139,445 (I use guarddog for that)
  4. Edit smb.conf:
    sudo gedit /etc/samba/smb.conf
    

    Paste the following there:

     

    [global]
    workgroup = LOCALNET
    realm = LOCALNET
    netbios name = LOCALNET
    netbios aliases = LOCALNET
    server string = LOCALNET Samba Server
    username map = /etc/samba/smbusers
    smb passwd file = /etc/samba/smbpasswd
    log file = /var/log/samba/%m.log
    max log size = 50
    use spnego = No
    socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
    printcap name = /etc/printcap
    dns proxy = No
    ldap ssl = no
    idmap uid = 16777216-33554431
    idmap gid = 16777216-33554431
    
    [printers]
    comment = All Printers
    path = /var/spool/samba
    printable = Yes
    browseable = No
    
    [localshare]
    comment = Home Directories for All Users
    path = /home/shares/allusers/
    username = @users
    force group = users
    read only = No
    create mask = 0660
    security mask = 0660
    directory mask = 0771
    directory security mask = 0771

     

  5. Edit smbusers:
     sudo gedit /etc/samba/smbusers

    Paste the following there:

    # Unix_name = SMB_name1 SMB_name2 ...
    root = administrator admin
    someuseruser1 = someuseruser1
    
  6. Start server:
     sudo smbpasswd -a root sudo smbpasswd -a someuseruser1 sudo /sbin/chkconfig smb on sudo /sbin/chkconfig nmb on
  7. In konqueror or krusader (or whatever):
    smb://someuseruser1@localnet/localshare
    

On Windows Mobile 6 device (ASUS P535, with WiFi) works in Total Commander CE and VM Net Browser at address \localnetlocalshare (will ask for username and password).

Confirmed with Acer Aspire 6930 under Fedora 9 and 10

Additionally need:

sudo /sbin/service smb start
sudo /sbin/service nmb start
sudo chown -R root.users /PATH/TO/LOCALSHARE
sudo chmod 0775 -R /PATH/TO/LOCALSHARE

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.