This step by step tutorial will help you install and configure Samba on Ubuntu OS.
Update apt repositories before initiating the install process.
sudo apt update
To install samba run following commands on terminal.
sudo apt install samba
Verify Samba Installation
Run following command to verify installation of Samba file server.
Above command will output following text if the installation was successful.
samba: /usr/sbin/samba /usr/lib/samba /etc/samba /usr/share/samba /usr/share/man/man8/samba.8.gz /usr/share/man/man7/samba.7.gz
Configure Samba file sharing
Create a directory that you want to share with other.
Above command will create a directory named
myshare in home directory of currently logged in user. Next we will edit Samba configuration to share newly created directory
Edit the Samba configuration file located at
sudo nano /etc/samba/smb.conf
Add following lines at the bottom of opened configuration file.
[myshare] comment = My Samba Share path = /home/<username>/myshare read only = no browsable = yes
Save the file by pressing
Ctrl+O and exit the nano editor by pressing
Restart the Samba service named
smbd to reload the new configurations.
sudo service smbd restart
Creating User Account to access share
Samba doesn’t use the system account’s password, we need to setup Sambapassword for our account. Run following command by replacing the
<username>with a valid system user, it will ask for password and verify password. We will need to provide this password while accessing the Samba Share from remote computer.
sudo smbpasswd -a <username>
Accessing the share from remote computer
- Open finder and click on
Go > Connect to Servermenu item or press
Cmd + Kshortcut key.
- Enter the
smb://<IP-ADDRESS>/mysharein Server Address input box and Click
Registered Useroption, enter
Connectbutton to open the Samba share.
On Microsoft Windows
Follow this tutorial to access Samba share from Microsoft Windows 10 pc.
Thanks for reading, please let me know if you have any questions, issues or comments.