How to Mount a SMB/CIFS Share as an Automount on CentOS/Fedora/RHEL
In This tutorial we will show you How to automatically mount/unmount a SMB/CIFS Windows share on a CentOS/Fedora/RHEL server.
You need to open terminal and follow the instructions bellow:
1-Install the Automounter
# yum install autofs
2-Install samba (client)
#yum install samba-client samba-common
3-Next you have to add an entry to the file /etc/auto.master, like so:
# file: /etc/auto.master
/mnt/cifs_share /etc/auto.cifs --timeout=600 --ghost
4-Now we’ll need to create the mount point:
% mkdir /mnt/cifs_share
5-now create the file /etc/auto.cifs:
share_data -fstype=cifs,rw,noperm,credentials=/etc/credentials.txt ://192.168.1.x/windows_data
6-And finally, create the credentials.txt file.
7-The last step is to startup the automounter service (/etc/init.d/autofs).
% /etc/init.d/autofs start
8-Once done you should now be able to cd to /mnt/cifs_share/windwos_data.
% cd /mnt/cifs_share/windows_data
9-You can confirm that the mount is being accessed correctly by checking the active mounts:
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
//192.168.1.x/windows_data on /mnt/cifs_share/windows_data type cifs (rw,mand)
And is done
Like us on Facebook
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- OpenLDAP Installation and Configuration in Ubuntu 12.10/13.04/13.10 And Debian 6/7 : OpenLDAP is a free open source Light Weight Directory Access protocol developed by the OpenLDAP proj...0 comments |
- Configure Your Browser To Use Tor On Ubuntu/Debian/Linux Mint : Tor, The Onion Router, is a network of Virtual Tunnels that allows users to communicate securely and...1 comment |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...0 comments |
- Twelve Vulnerabilities Have Been Fixed In Ubuntu 12.04, Time To Update : Canonical has released security updates for Ubuntu 12.04 LTS and advices to update your system as so...0 comments |
- TeamViewer 9 Final Has Been Released!
- Twelve Vulnerabilities Have Been Fixed In Ubuntu 12.04, Time To Update
- OpenLDAP Installation and Configuration in Ubuntu 12.10/13.04/13.10 And Debian 6/7
- Configure Your Browser To Use Tor On Ubuntu/Debian/Linux Mint
- Setup A Full Featured ITIL Management System Using Integria IMS On CentOS 6
- Install LibreOffice 4.1.3 in Elementary OS ‘Luna’
- How To Install Simple Scan in Crunchbang ‘Waldorf’
- Selene Media Encoder: Convert Audio, Video Files To Most Popular Formats
- Linux Kernel 3.12.2 Is Available For Download! Install / Upgrade Instructions
- CentOS 6.5 Has Been Officially Released!
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .