以上就是我的smb.conf的全部有效内容,还有一些常用选项在下边给出解释 interfaces 选择samba服务器使用的网络界面(如果有多块网卡时可以按实际配置),本机只有一 块网卡,故忽略配置此项 password server 如果安全级别为server或domain,使用此选项指定要验证密码的主机 password level username level 上边两项用来设置当验证用户口令和帐号时最多允许几个大小写字母不同,默认 为0 max disk size 设置能够共享的最大磁盘空间 单位为MB 默认为0,表示无限制 max open file 设置同一客户端最多能打开文件的数目
接下来为wangge设置密码,退出vi,以root登录 [root@localhost]#cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd [root@localhost]#chmod 500 /etc/samba [root@localhost]#chmod 600 /etc/samba/smbpasswd 接下来设置密码 [root@localhost]#smbpasswd wangge New SMB passwored: Retype SMB password: 如果系统提示 Password changed for user wangge 则表示密码设置成功
将上述配置保存后,可以用命令testparm检测一下有没有语法错误 [root@localhost samba]# testparm Load smb config files from /etc/samba/smb.conf Processing section "[myshare]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions
[global] dos charset = CP950 unix charset = BIG5 netbios name = SMB-SERVER server string = Samba Server Version %v smb passwd file = /etc/samba/smbpasswd guest account = wangge log file = /var/log/samba/log.%m max log size = 50 load printers = No domain master = No hosts allow = 127., 192.168.1., 192.168.0., 172.17.
Sharename Type Comment --------- ---- ------- myshare Disk wangge IPC$ IPC IPC Service (Samba Server Version 3.0.25-3) Anonymous login successful Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.25-3]
Sharename Type Comment --------- ---- ------- E$ Disk 默_共享 IPC$ IPC _程 IPC D$ Disk 默_共享 F$ Disk 默_共享 music Disk ADMIN$ Disk _程管理 C$ Disk 默_共享 session request to 192.168.1.4 failed (Called name not present) session request to 192 failed (Called name not present) Domain=[ACER-74DFA87541] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]