Skip navigation
Dude!

automount cifs OL7

Posted by Dude! Oct 12, 2017

Regarding https://docs.oracle.com/cd/E52668_01/E54669/html/ol7-s4-fsadmin.html

 

According to my tests, using a file to specify login credentials and CIFS only works when /sbin/mount.cifs exists. Otherwise, you'll see a message like: "CIFS VFS: No username specified". This requires the installation of the cifs-utils package.

 

For example:

 

#  yum install autofs cifs-utils

 

/etc/auto.master:

+auto.master

/mnt /etc/auto.backup --timeout=600 --ghost

 

/etc/auto.backup:

backup -fstype=cifs,rw,noperm,credentials=/root/.backup_credentials ://server1.example.com/backup

 

/root/.backup_credentials:

username=dude

password=mysecret

 

# systemctl enable autofs

# systemctl restart autofs

 

Usage:

cd /mnt

cd backup

ls