3、为保证用户账号及密码安全,将账号与密码存放在可读的文件中
//192.168.2.1/public /tmp/abc cifs defaults,credentials=/etc/samba/pwd.txt 0 0
#vim /etc/samba/pwd.txt (以username,password为关键字进行读取,可以写多个用户,第一个用户可以,就直接挂载了)
username=user1
password=123
#chmod 400 /etc/samba/pwd.txt
4、为节约带宽,设置超时后,自动卸载
#vim /etc/auto.master
/home /etc/smb.misc --timeout=05
#vim /etc/smb.misc
smb -fstype=cifs,credentials=/etc/samba/pwd.txt ://192.168.2.1/public
:wq
#vim /etc/samba/pwd.txt
username=user1
password=123
# service autofs start