This guide explains how to configure samba server in Ubuntu 16.04 with anonymous & secured samba servers. Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients. Samba is freely available, unlike other SMB/CIFS implementations, and allows for interoperability between Linux/Unix servers and Windows-based clients. I’ll be logged in as root.
Step 1 – Update repositories.
Step 2 – Install samba.
Step 3 – Backup config file .
Step 4 – Open config file.
Step 5 – Configuration of Samba server.
1 – [global] – The rules defined here apply for all shared folders
2 – follow symlinks = yes //allow using shortcut
3 – unix extensions – no //denied using unix extention
4 – [ftp] // name of share
5 – path = /srv/samba/ftp //path of share
6 – create mask = 0775
– force create mode = 0775
– directory mask = 0775
– force create mode = 0775 // These are the permissions, which will be used for creation of files and folders. In this way the files and folders will be edited only by the users of the particular group. If you want these files and folders to be edited by all users, you have to change the permissions to 777
7 -valid users
– write list = mslavov // The users who will have permission to write in this directory
8 – [yoursharedfolder]
– comment = yoursharedfolder
– path = /srv/samba/yoursharedfolder //If you want to create your own shared folder, you just have to change the folders names with your folders names and to add the rules which you want for your folder.
This is mine config file.
follow symlinks = yes
wide links = yes
unix extensions = no
comment = ftp
path = /srv/samba/ftp
browseable = yes
valid users = mslavov, YOURUSER, test, test1
write list = mslavov, YOURUSER, test, test1
create mask = 0775
force create mode = 0775
public = no
guest only = no
directory mask = 0775
force directory mode = 0775
store dos attributes = Yes
hide unreadable = yes
hide files = /examples.desktop
comment = yoursharedfolder
path = /srv/samba/yoursharedfolder
Step 6 – Add users in Samba Server and after that add the user for particular folder in config file /etc/samba/smb.conf. Then you must restart samba service.
Step 7 – Now you must restart samba service.
Step 8 – Check samba status.
Step 9 – Create folder for your share and give full right.
root@mail:/# chmod 777 /etc/samba/ftp
Step 10 – Add share folder on Windows.
My Computer -> Map network drive -> \\Ip address of samba server\\name of your shared folder -> add your samba user and password.