Linux

Auto-mount-Samba-(Share)-on-Cent

2018-01-15  本文已影响8人  ___n
Install cifs and autofs

yum install cifs-util autofs -y

Create file to put username and password to your shared folder

cd

mkdir tools

vi tools/secret.txt

username=
password=
Create directory. You can create your own directory structure.

mkdir /var/www/html

Edit autofs main config file

vi /etc/auto.master

/var/www/html   /etc/auto.dev

Create and edit auto mount config for DEV environment

vi /etc/auto.dev

local_shared_name -fstype=cifs,credentials=/root/tools/secret.txt,nounix,sec=ntlmssp ://windows_computer_name/shared_name
Restart “autofs” and enable start on system boot

systemctl restart autofs
systemctl enable autofs
上一篇下一篇

猜你喜欢

热点阅读