samba验证配置文件
在samba配置好后可以用usr@host:~$testparm
验证当前配置。因为有一些没生效的配置不会出现在这里,如果和你所想要的配置有差别,在这个函数的输出就能看到。如:我在设置无密码访问共享资源时怎么设置都不生效,后来发现是guest account = nobody
的问题,不能设置成nobody,后来我改成别的用户就好使了。
Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) WARNING: The "syslog" option is deprecated Processing section "[printers]" Processing section "[share]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions # Global parameters [global] server string = %h server (Samba, Ubuntu) server role = standalone server security = USER #很多文章都说这里要设置成share才能完成无密码访问,但share这个参数在我使用的Version 4.3.11-Ubuntu版本中已经取消了。 map to guest = Bad User obey pam restrictions = Yes guest account = wanglei pam password change = Yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . unix password sync = Yes syslog = 0 log file = /var/log/samba/log.%m max log size = 1000 dns proxy = No usershare allow guests = Yes panic action = /usr/share/samba/panic-action %d idmap config * : backend = tdb #新版本中并不使用smbpasswd文件存放samba用户,而是用数据库存,想要查看用哪些用户要使用pdbedit -L这个命令要有super权限。 [printers] comment = All Printers path = /var/spool/samba create mask = 0700 printable = Yes browseable = No [share] comment = share files path = /mnt/lvdir/downloads/share read only = No create mask = 0777 guest only = Yes guest ok = Yes