Install Samba on Ubuntu 20.04

Samba allows you to share your files with your Windows, Linux, Chrome OS computers, etc. It’s not really part of LAMP but for a development server it’s nice to have it.

1. Let’s install it

apt-get install samba

2. Edit the configuration file

vi /etc/samba/smb.conf

Change security to user (under [global] section) and add your folder at the bottom of the file

security = user

[php]
   comment = PHP
browseable = yes
path = /var/www/html
guest ok = no
   read only = no
   writable = yes
force user = www-data
force group = www-data

3. Add a user and set it’s password

sudo adduser myuser
sudo smbpasswd -a myuser

4. Restart the service

service smbd restart
service nmbd restart

Leave a Reply

Your email address will not be published. Required fields are marked *