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.

username=smb_username
password=smb_password

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.

//192.168.1.10/share /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 Look Linux.

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

About the author

mm

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