Samba Configuration

Samba logo

When configuring a Samba server, remember that the discovery of machines on the network happens not only with DNS but also with a few other mechanisms too. I recently setup a number of virtual machines for developers, that were created by cloning a single instance.

Mistakenly, I thought that adding a DNS config entry for each virtual machine on the host's /etc/hosts would be enough, but it's not. What we found was that everyone was connecting to the same VM (another requirement was that they be on the same subnet).

Since I don't have access to the network's DHCP server, the key is to change each Samba server's NetBios name to be unique.

A dump of useful settings:

security = user
netbios name = centosvm-mark

[webroot]
comment = The Apache webroot
path = /var/www/html
browseable = yes
read only = no
create mask = 664
directory mask = 775

Add user:

smbpasswd -a username

List users:

sudo pdbedit -w -L