1. You will learn how to install Samba Server on Ubuntu.
2. How to share files across the local network.
Samba server is used to share file between Linux and Windows system on the same network. Samba server is open source. I will let you know how to install and configure samba server on ubuntu.
Install Samba Server
Firstly, install the required package for the Samba server
arun@arun-virtual-machine:~$ sudo apt-get install samba
Configure Samba Server
Now, copy the main config file for backup purposes.
arun@arun-virtual-machine:~$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.original
Open the config file and add the below-mentioned information at the end of the file.
comment = File Server
browsable = yes
path = /test
guest ok = yes
read only = no
create mask = 0755
- [sambashare] : This is the name of our share.
- comment: Short description of share.
- browsable: if set yes, the client can see share under the ‘Network’ on a windows explorer or in Ubuntu’s file manager.
- path: shared directory.
- guest ok: Client can connect to share without asking for the username and password.
- read only: if set ‘no’ it means the client has to write permission. If it is set to ‘yes’, the client only have read permission.
- create mask: permission set for the new files.
Samba server is configured. Now finally verify the samba server settings:
Restart the samba service to apply changes.
arun@arun-virtual-machine:~$ sudo systemctl restart smbd
Now next step is to set permission on share directory. We can set permission on share directory as per our requirement.
arun@arun-virtual-machine:~$ sudo chmod 777 /sambashare
arun@arun-virtual-machine:~$ sudo chown nobody:nogroup /sambashare
Perfect !! Samba server is ready. Now you can share the files over the same network between Linux and Windows OS. In the next tutorial, I will show you how to add a samba user on Ubuntu.