samba
目录本文内容来自:Linux搭建samba服务及使用案例
安装
- 首先安装samba服务
yum install samba
- 更改/etc/samba/smb.conf下配置文件
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[myshare]
#对共享的描述
comment = j1900_disk_01
#所有用户的读写权限
writable = yes
#指定共享目录
path = /home/disk_01
#设置上传文件的权限
create mask = 644
#设置目录的权限
directory mask = 755
- 创建新用户
smbpasswd命令 属于samba套件,能够实现添加或删除samba用户和为用户修改密码。-a:
向smbpasswd文件中添加用户;
useradd root
smbpasswd -a root
- 查看samba用户列表
pdbedit -L
- 重启服务smb和nmb
systemctl restart smb nmb
Windows测试链接
使用快捷键WIN+R 打开 \\192.168.200.100