yum install samba
vi /etc/samba/smb.conf[global]workgroup = SAMBAsecurity = userpassdb backend = tdbsamprinting = cupsprintcap name = cupsload printers = yescups options = raw[data]comment = datapath = /data/part1/sharebrowseable = yeswritable = yesguest ok = yes
添加一个用户
useradd sambauser
SMB与系统共用用户名,但不共用密码。也就是说,上面设置的用户名对SMB有效,但密码对SMB无效,需用smbpasswd命令添加一个密码。
smbpasswd -a sambauser
systemctl start smbsystemctl enable smb
挂载命令
mount -t cifs //172.16.0.15/data /data/part1 -o username=sambauser,password=sambauser,iocharset=utf8