Samba Server installation on Ubuntu 14, 16 and 18
Ubuntu Tips: Install Samba File Server
About This Guide
In this text, I teach how to create a network share via Samba using the CLI (Command-line interface/Linux Terminal) in an uncomplicated, simple and brief way targeting Windows users.
Installation
Start by opening a new Terminal window or login via SSH to the Ubuntu system you wish to modify. Then run the following command:
1 | sudo apt-get install -y samba samba-common python-glade2 system-config-samba |
To configure samba, edit the file /etc/samba/smb.conf. I will use nano as editor and make a backup of the original file before I start to change it. The backup file is named /etc/samba/smb.conf.bak
1 | sudo cp -pf /etc/samba/smb.conf /etc/samba/smb.conf.bak |
Open the Samba configuration file with nano:
1 | sudo nano /etc/samba/smb.conf |
Moreover, add the following lines.
1 2 3 4 5 6 7 8 | #============================ Share Definitions ============================== [Anonymous] path = /samba/anonymous browsable =yes writeable = yes guest ok = yes read only = no force user = nobody |
Then I’ll create a directory for the anonymous share.
1 | sudo mkdir -p /samba/anonymous |
Set the correct permissions.
1 2 | sudo chmod -R 0777 /samba/anonymous/ sudo chown -R nobody:nogroup /samba/anonymous/ |
Moreover, restart Samba to apply the new configuration.
1 | sudo service smbd restart |
It’s ready.