Linux Administrator

How to Mount Samba Share on Ubuntu and Debian System?

In this article I will show how you can mount samaba shared directory on your Ubuntu and Debian system. the step by step guide for the mounting of remote samba share on Ubuntu and Debian system. Also enables to automount shared drive even after system reboot.

Mount Samba Share On Ubuntu/Debian

Follow the below steps:

1. First of all install cifs-utils package on your system. Than run the below command on the terminal for the installation.

$ sudo apt-get install cifs-utils

2. After installing package now create a directory to mount the share drive.

$ sudo mkdir /media/share

3. Next create a credentials file to your system. Make this as a hidden file using dot (.) for security purpose. It’s good to create it in your home directory.

$ vim ~/.smb

Set the samba username and password to above file.


4. Now edit the /etc/fstab file which is responsible to automount any filesystem during system boot. So this is the best place to automount directory.

$ sudo vim /etc/fstab

Add the line at end of the file as follows. Change values as per yours.

// /media/share cifs credentials=/home/user/.smb,users,rw,iocharset=utf8,sec=ntlm 0 0

Run the below command after adding the above line in /etc/fstab file to mount the share.

$ mount -a
Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website To become an author at LookLinux Submit Article. Stay connected to Facebook.

About the author


Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment