1SAMBA_USERNAME=''
2DATE="$(date +%d%h%Y-%H%M%S)"
3
4# Install Samba
5sudo apt install -y samba
6
7# Config
8# make a backup of original conf file
9sudo /etc/samba/smb.conf /etc/samba/smb_bak_${DATE}.conf
10
11# edit conf file and add share folders
12echo -e "
13# SHARED FOLDERS
14# Added by Aamnah on $(date)
15
16[Movies]
17 comment = Movies
18 path = /media/NAS/MOVIES/
19 browseable = yes
20 read only = no
21 guest ok = yes
22
23[TVShows]
24 comment = TV Show
25 path = "/media/NAS/TV Shows/"
26 browseable = yes
27 read only = no
28 guest ok = yes
29" >> /etc/samba/smb.conf
30
31
32# restart Samba
33sudo /etc/init.d/samba restart
34Create a user to use with Samba
35# create user
36sudo useradd bumblebee -m -G users
37# set password for the user you just created
38sudo passwd bumblebee
39Set a password for your user in Samba
40sudo smbpasswd -a <username>