Configuring Samba

Generally I setup samba for a group of people to contribute to an area of the server such as /opt/theDirectoryToShare .

First off you start by creating the group
groupadd staff

Then add each member to the group
usermod -g staff user1

Then add each user to the samba password file
smbpasswd -a user1

Then make the directory you are accessing writeable to the group

chmod -R g+w /opt/theDirectoryToShare
chgrp -R staff /opt/theDirectoryToShare

Then make your smb.conf like this

[global]
        workgroup = THISGROUP
        server string = ServerName
        netbios name = ServerName

        security = user
        passdb backend = tdbsam

        load printers = no
        printing = bsd
        printcap name = /dev/null
        disable spoolss = yes

[home]
        path = /home/%u
        writable = yes

[www]
        path = /var/www/
        writable = yes
        force group = users
        force user = apache
        create mode = 0664
        force create mode = 0664
        directory mode = 0775
        force directory mode = 0775
[tmp]
        comment = Temporary file space
        path = /tmp
        read only = no
        public = yes

Mounting a share from the command line

This command will show you all the available shares on the network (must be root)
smbtree

smbtree -U anotherUsername

Then to mount

mkdir /mnt/windowstemp
mount -t cifs //192.168.0.210/Temp /mnt/windowstemp
mount -t cifs //192.168.0.210/files -o username=<username>,password=<password> /mnt/mountdirectory

List all users
pdbedit -L -v

Searching for servers
findsmb
smbstatus

http://toasterz.com/node/27

Tags: , , , ,

Leave a Reply