Windows共享已由fstab挂载并且可以正常工作,但共享主机重新启动时共享会丢失
有没有办法在共享主机返回时配置要自动挂载的共享?
Windows共享已由fstab挂载并且可以正常工作,但共享主机重新启动时共享会丢失
有没有办法在共享主机返回时配置要自动挂载的共享?
Answers:
编辑为Root / etc / fstab
add //Ip_Server/folder_server /folder_local cifs username=user_windows,password=password-windows,rw,users,uid=user_linux,gid=group_linux 0 0
例:
//192.168.0.100/FolderInWin\share_Folder_InWin /home/pepe/MyFolder cifs username=pepeinWin,password=pepeinWin1234,rw,users,uid=pepe,gid=users 0 0
每次启动PC时都会挂载
使用autofs来实现这一目标
#Create sharepoint at: /sharebase/share
service autofs stop
nano /etc/auto.master
Add: /sharebase /etc/auto.cifs --timeout=300 --ghost
nano /etc/auto.cifs
Add: share -fstype=cifs,domain=mydomain,uid=www-data,gid=www-data,iocharset=utf8,file_mode=0777,dir_mode=0777,credentials=/root/.cifs ://SAMBA.share/
nano /root/.cifs
Add: username=myusername
Add: password=mypassword
service autofs start