• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How To Install & Configure Samba In Ubuntu 16.04 Using Terminal

How To Install & Configure Samba In Ubuntu 16.04 Using Terminal

By Sourabh / June 22, 2016 Category: How To, Ubuntu

How to share files using Samba in Ubuntu Linux. How to install Samba in Ubuntu 16.04 using Terminal. How to use Samba server – Learn Samba server configuration in Ubuntu. Samba is a popular cross-platform file and print-sharing solution.

Installing Samba

samba-ubuntu

Samba is not installed on Ubuntu Systems by default. Users have to install Samba additionally. Run the following command in terminal to install Samba:

sudo apt-get install samba

Users can also install Samba via the Ubuntu Software Center.

Configuring Samba

The default configuration file (Samba configuration file) is commonly found at /etc/samba/smb.conf or /usr/local/samba/lib/smb.conf. Run the command given below to edit and configure main Samba configuration file. Please note that to configure Samba via CLI you will need root privilege or simply use sudo.

gksu gedit /etc/samba/smb.conf

The first thing to edit is “workgroup” and “security” key/value pairs in the [global] section of /etc/samba/smb.conf:

workgroup = EXAMPLE
…
security = user

workgroup-samba

Please note that the security parameter can be found at the bottom in the [global] section, and is always commented by default. Under the “Share Definitions” section you can edit and configure the files/folders that you want to share with others.

For example, if you want the Home folder to be accessible via Windows, uncomment and remove the “;” at the front of the following lines:

[homes] comment = Home Directories
browseable = yes
valid users = %S

Change the browseable value to “yes” (read description below).

For a directory to share, either create a new section at the bottom of the file or uncomment the following:

[share] comment = Ubuntu File Server Share
path = /srv/samba/share
browsable = yes
guest ok = yes
read only = no
create mask = 0755

Description of the above parameters:

  • path: the path to the directory to share.
  • browsable: enables Windows to browse the shared directory via Windows Explorer application.
  • guest ok: allows clients to connect to the share without a password.
  • read only: Read only mode or write/edit privileges to be granted. Write/edit privileges are allowed only when the value is no. If the value is yes, then access to the share is always read only.

Setting Samba User Password

Another most important aspect of configuring Samba is to set user password and/or add a Samba user. To add a specific username to the Samba user lits, run the following command:

sudo smbpasswd -a

Please remember to replace with the desired username. Apart from adding the existing username, you can also create a new user account. To create a user account, use the following command:

adduser

Create Directory and Change Permissions

Run the following commands to create directory and grant the permissions:

sudo mkdir -p /srv/samba/share
sudo chown nobody:nogroup /srv/samba/share/

Finally, restart the samba services to enable the new configuration:

sudo restart smbd
sudo restart nmbd
sudo systemctl restart smbd.service nmbd.service

Tags: Apt-Get Install Samba, Configurar Samba Ubuntu, Configure Samba Ubuntu 16.04, How To Configure Samba In Ubuntu 16.04 Using Terminal, How To Install Samba In Ubuntu, How To Install Samba In Ubuntu 12.04 Using Terminal, How To Install Samba In Ubuntu 16.04 Using Terminal, How To Share File Using Samba, How To Share Files Using Samba In Linux, How To Share Files Using Samba In Ubuntu, How To Use Samba Server Ubuntu, Install Samba Linux, Install Samba Server On Ubuntu, Install Samba Ubuntu 16.04, Install Smb Ubuntu, Restart Samba Ubuntu, Samba Client Ubuntu, Samba File Server Ubuntu, Samba File Sharing Android, Samba File Sharing Apk, Samba File Sharing App, Samba File Sharing Ubuntu, Samba File Sharing Windows, Samba File Sharing Windows 7, Samba Server Configuration In Ubuntu, Samba Ubuntu 12.04 Server, Samba Ubuntu 12.04 Setup, Samba Ubuntu 16.04 Configure, Samba Ubuntu 16.04 Install, Samba Ubuntu 16.04 Setup, Samba Ubuntu 16.04 Use, Samba Ubuntu 16.04 Using, Samba Ubuntu Download, Samba Ubuntu Install, Ubuntu 12.04 Restart Samba, Ubuntu 14.04 Samba, Ubuntu Install Samba Client, Ubuntu Samba Gui, Use Samba Ubuntu 16.04, Using Samba Ubuntu 16.04

Primary Sidebar

Latest Posts

Ubuntu 25.04 ‘Plucky Puffin’ Is Available To Download

How to Login as Root User in Linux Terminal

Install Firefox In Ubuntu Terminal Command Line

How To Check Kernel Installed Date In Linux Ubuntu

How To List All Kernel Modules That Are Loaded In Ubuntu

Enable Ubuntu Auto Login Without Password

Download Ubuntu 25.04 Official Default Wallpapers

How To Fix Initramfs Error In Ubuntu Command Line

How To Check All Available Kernel Version In Linux Ubuntu

3 Best Artificial Intelligence Domain Name Generators

© 2025 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap