Linux Administrator

How to Mount Samba Share on CentOS/Fedora/Redhat?

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

Mount Samba Share On CentOs/Fedora/Redhat

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.

# yum install cifs-utils

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

# 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.

# vim /etc/fstab

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

//192.168.1.5/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 LookLinux.

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 LookLinux 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