testparm smb.conf //检查配置文件的语法
Load smb config files from smb.conf
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions //这里可以ctrl+c跳过
[root@sheng samba]# smbpasswd -a zhangsan //建立samba用户并指定密码,用户必须是系统用户
New SMB password:
Retype new SMB password:
Added user zhangsan.
[root@sheng samba]# smbpasswd -a lisi
New SMB password:
Retype new SMB password:
Added user lisi.
[root@sheng samba]# pdbedit -L //列出Samba用户列表,读取passdb.tdb数据库文件
zhangsan:1000:
lisi:1001:
[root@sheng samba]# smbclient -L 192.168.245.10 //查看客户端的共享文件
Enter SAMBA\root's password:
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk 远程管理
C$ Disk 默认共享
D$ Disk 默认共享
IPC$ IPC 远程 IPC
share Disk
[root@sheng samba]# mount.cifs //192.168.245.10/share /opt/win //挂载windows的共享文件夹到linux
Password for root@//192.168.245.10/share: //这里不用输入密码直接回车