以上就是我的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]