First, grab the latest copy of Samba. You can do this through any package manager. For Ubuntu and other Debian based systems, the command is:
sudo apt-get install samba
Before you make any changes, stop the service:
sudo /etc/init.d/samba stop
Backup the default configuration file:
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bkup
You can actually just make changes to the smb.conf file, but it is still a good idea to make a backup file anyway. In that case, the command would be:
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bkup