How to install and configure samba on Ubuntu 16.04 LTS?

Simple how to tutorials for linux.
Post Reply
User avatar
sonik
Site Admin
Posts: 37
Joined: 12 Nov 2018, 22:12

How to install and configure samba on Ubuntu 16.04 LTS?

Post by sonik » 30 May 2019, 11:21

How to install and configure samba on ubuntu 16.04 LTS?
Install:

Code: Select all

sudo apt-get install samba
Add user for samba

Code: Select all

sudo smbpasswd -a sonik
Make a directory to share:

Code: Select all

mkdir /home/sonik/sarg
mkdir /home/sonik/public
Edit the config file:

Code: Select all

pico /etc/samba/smb.conf
Add at the bottom of the file the new directory that we created:

Code: Select all

[sarg]
# This share allows only authenticated users
path = /home/sonik/sarg
available = yes
valid users = sonik
read only = no
browseable = yes
public = yes
writable = yes
[guest]
# This share allows anonymous (guest) access
# without authentication!
path = /home/sonik/public
read only = no
guest ok = yes
Restart samba:

Code: Select all

sudo /etc/init.d/samba restart
Restart samba ubuntu 18.04

Code: Select all

sudo systemctl restart smbd
Test samba config:

Code: Select all

sudo testparm
How to check samba version?

Code: Select all

smbstatus

Post Reply