Samba

From Mark Furneaux's Wiki
Jump to: navigation, search

Samba is an open source implementation of the SMB/CIFS networking protocol for Linux and UNIX systems.

Installation

The following assumes we are installing on an Ubuntu host. Install the samba package by running:
# apt-get install samba

Configuration

All settings are configured in /etc/samba/smb.conf, and the changes required are the following:

 1    workgroup = furneaux.ca
 2 
 3    interfaces = 127.0.0.0/8 bond0
 4 
 5    security = user
 6    map to guest = bad user
 7    usershare owner only = false
 8    usershare allow guests = yes
 9 
10    use sendfile = yes
11    socket options = TCP_NODELAY IPTOS_LOWDELAY
12 
13 [storage]
14 	path = /tank/storage
15 	writeable = yes
16 	browsable = yes
17 	valid users = mark
18 
19 [music]
20 	path = /tank/storage/Music
21 	writeable = no
22 	browsable = yes
23 	guest ok = yes

Some changes can be applied by simply uncommenting the lines. Lines 10 and 11 are for performance reasons.

For each user account on the system, add a Samba account for that user by running:
# smbpasswd -a mark
assuming the username is mark.

You can test that the settings are valid by running:
# testparm
and inspecting the output.

Restart or reload the Samba config by running:
# service smbd restart
or
# service smbd reload