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

        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

        path = /home/%u
        writable = yes

        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
        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 -U anotherUsername

Then to mount

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

List all users
pdbedit -L -v

Searching for servers

Tags: , , , ,

Leave a Reply