当Windows服务器(重新)启动时,在Linux下重新安装Windows / samba共享


0

Windows共享已由fstab挂载并且可以正常工作,但共享主机重新启动时共享会丢失

有没有办法在共享主机返回时配置要自动挂载的共享?

Answers:


0

编辑为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时都会挂载


该共享位于Windows服务器上,并在linux-server上的/ etc / fstab中声明://192.168.0.100/felles/ / home / user / custom / share / cifs ro,domain = our.domain,uid = www -data,gid = www-data,credentials = / etc / smbcredentials,iocharset = utf8,file_mode = 0777,dir_mode = 0777 0 0问题是如果windows机器重新启动,linux服务器将丢失共享

0

使用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
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.