本文共 1024 字,大约阅读时间需要 3 分钟。
在 OpenStack 环境中安装 Samba 服务器,执行以下命令:
yum -y install samba
重启或启动 Samba 服务:
systemctl restart smb
配置 Samba 用户,支持以下两种方式:
useradd username
通过 Samba 内置工具进行配置:
pdbedit -a username
pdbedit -L
pdbedit -x username
smbpasswd -a username
smbpasswd -d username
smbpasswd -e username
smbpasswd -n username
smbpasswd -x username
编辑 samba
FS 的配置文件:
vim /etc/samba/smb.conf
示例配置:
[global] workgroup = MYGROUP homes [printers] [samba] path = /smb/ public = yes browseable = yes read only = yes writable = yes write list = user valid users = user username1 hosts allow = 192.168.1.0/24 hosts deny = 0.0.0.0/32 comment = Samba FS root目录
修改指定目录的 ACL:
setfacl -m u:username:rwx /smb/
在客户端访问共享目录前,确保安装了 samba-client
:
smbclient -L 192.168.1.100
连接远程共享:
smbclient -U username //192.168.1.100/samba
完成以上配置后,可通过客户端工具如 Explorer
或 smbclient
按需访问共享目录。
转载地址:http://hfzfk.baihongyu.com/