samba服务
直连存储
网络附加存储
存储区域网络
samba有协议smb和cifs协议通用的
安装包
samba服务端
samba-client客户端
/etc/samba/smb.conf配置文件
global全局配置
workgroup = WORKGROUP
security = user 注意现在share也要认证
map to guest = Bad User 允许匿名访问
netbios name = openEuler
inteface = ens33
hosts allow = 192.168.1.0/24
homes 共享名称
valid users = 指定允许访问的用户
invalid users = 不允许访问的用户
write list = 可写
read list = 可读
public = yes 该目录是否可见
systemctl restart smb/nmb(netbios网络发现协议)
test_dir 匿名访问
comment = oepnEuler 描述信息
path = /data
public = yes 该目录是否可见
writtable = yes
gest ok = yes
给文件权限
chmod 777 /data
linux客户端访问(先安装sambc-client、cifs-utils包)
smbclient -L //IP 测试
匿名挂载
mount -t cifs //172.16.1.100/test_dir /mnt/
需要用户名密码挂载
website_data
path = /openEuler
write list = bob
chmod 755 openEuler 给文件权限
chown bob.bob /openEuler
smbpasswd -a bob
mount -t cifs //172.16.1.100/test_dir /mnt/ -o username=bob
samba两个协议
systemctl restart smb/nmb(netbios网络发现协议)