怎样在Linux系统搭建Samba共享服务器

2025-04-28 13:25:56
推荐回答(1个)
回答1:

3、安装samba服务
[root@localhost /]# yum install samba -y
4、创建共享用户
[root@localhost /]# smbpasswd -a smb
[root@localhost /]# smbpasswd -a smb
5、修改配置文件
[root@localhost /]# vim /etc/samba/smb.conf
workgroup = WORKGROUP //Win需要修改为工作组
server string = Samba Server Version %v
security = user //可以改为everyone
passdb backend = tdbsam
[test]
path = /test
public = yes
writeable = yes
valid users = smb
[share]
path = /share
public = yes
writeable = yes
valid users = smb
6、创建本地共享目录和文件权限
[root@localhost /]# mkdir /test /share
[root@localhost /]# chown -R smb.smb /test/ /share/
[root@localhost test]# touch tp1 tp2
[root@localhost test]# chmod 444 tp1
[root@localhost test]# chmod 666 tp2
[root@localhost test]# echo "111" > /test/tp1 //ceshi 文本
[root@localhost test]# echo "222" > /test/tp2
[root@localhost test]# service smb restart //开启服务 测试