Before making any modification to any files, first create a backup of smb.conf file
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
The open the configuration file for editing:
sudo gedit /etc/samba/smb.conf
In the section identified as Share Definitions, insert this piece of code. The path string should be the path for folder you will be sharing. If you want others to have the ability to write to that directory -
sudo mkdir -p /path/to/shared/folder sudo chown nobody.nogroup /path/to/shared/folder
[share] comment = Ubuntu File Server Share path = /path/to/shared/folder browsable = yes guest ok = no read only = no create mask = 0755
Once the configuration file has been saved, its time to restart the samba daemon
sudo restart smbd sudo restart nmbd
Once the samba daemon has restarted, you need to add a list of users who can access samba folder.
sudo smbpasswd -a username
To access this directory from windows, open My Computer -> Tools -> Map Network Drive
Folder address for this share would be:
NOTE: The folder is called share in the share definition. You can call it something else and edit the parameters based on the chosen share name.If you want to have access to this folder each time, make sure to save the password and check that option to reconnect at login.