Scramblings

Dev scratchpad. Digital garden

Samba setup

Jan 30, 2020 | Reading Time: 1 min

Steps to set up a samba server on ubuntu 18.04.

 1sudo apt update
 2sudo apt install samba
 3# Allow Samba in ufw firewall
 4sudo ufw allow 'Samba'
 5sudo systemctl status smbd
 6# Create a directory to host Samba share
 7sudo mkdir /disk1/samba
 8
 9#### User setup
10sudo useradd -M -d /disk1/samba/peewee -s /usr/sbin/nologin -G sambashare peewee
11sudo mkdir /disk1/samba/peewee
12sudo chown peewee:sambashare /disk1/samba/peewee
13sudo chmod 2770 /disk1/samba/peewee
14sudo smbpasswd -a peewee # set password here
15sudo smbpasswd -e peewee
16vi /etc/samba/smb.conf
17    ## Add these to the globals section to avoid name mangling and using appropriate charset
18    # [globals]
19    mangled names = no
20    dos charset = CP850
21    unix charset = UTF-8
22    [peewee]
23    path = /disk1/samba/peewee
24    browseable = yes
25    read only = no
26    force create mode = 0660
27    force directory mode = 2770
28    valid users = peewee
29
30sudo systemctl restart smbd
31sudo systemctl restart nmbd