Set up Samba - Ubuntu 12.04+

(Jason Bayton) #1

Originally published at:

1. Introduction Samba is an incredibly useful, open source program for setting up and/or accessing network shares from *nix operating systems. Samba shares are easily accessible from any modern OS using SMB/CIFS. Originally designed for DOS, SMB/CIFS is the most commonly used protocol for the sharing of directories and printers in the enterprise and Samba was created to guarantee a level of interoperability in mixed-OS environments. Check out the video below for a walkthrough demonstrating how to set up Samba on a Ubuntu 16.04 LTS host. The written guide is below as well. NB: Ubuntu 12.04 LTS is the earliest release I’ve used this with. It should work on earlier versions also, but your mileage may vary. SMBv1 The below video was published prior to the recent WannaCry/NotPetya global ransomware attacks and therefore doesn’t cover disabling SMBv1. To ensure Samba only permits connections over SMBv2 and newer, enter the following under the [global] area in /etc/samba/smb.conf: min protocol = SMB2 Ensure Samba is restarted in order to apply the change: sudo service smbd restart 2. Video 3. Installation From the commandline, run the following to install Samba: sudo apt install samba This will prompt you to install a pretty hefty number of packages, with the output looking similar to the below: Reading package lists… Done Building dependency tree Reading state information… Done The following additional packages will be installed: attr libaio1 libavahi-client3 libavahi-common-data libavahi-common3 libcups2 libfile-copy-recursive-perl libldb1 libpython-stdlib libpython2.7 libpython2.7-minimal libpython2.7-stdlib libtalloc2 libtdb1 libtevent0 libwbclient0 python python-crypto python-dnspython python-ldb python-minimal python-samba python-talloc…