目录
版本说明
CentOS 7.2
Samba 4.8.3
安装配置SAMBA服务
检查本地samba安装包
# rpm -qa | grep samba
samba-client-libs-4.8.3-4.el7.x86_64
samba-4.8.3-4.el7.x86_64
samba-common-libs-4.8.3-4.el7.x86_64
samba-common-tools-4.8.3-4.el7.x86_64
samba-common-4.8.3-4.el7.noarch
samba-libs-4.8.3-4.el7.x86_64
如果没有输出,则使用yum进行安装
# yum install -y samba
# rpm -qi samba
Name : samba
Epoch : 0
Version : 4.8.3
Release : 4.el7
Architecture: x86_64
Install Date: Fri 26 Jul 2019 01:32:27 PM CST
Group : Unspecified
Size : 2037669
License : GPLv3+ and LGPLv3+
Signature : RSA/SHA256, Mon 12 Nov 2018 10:46:06 PM CST, Key ID 24c6a8a7f4a80eb5
Source RPM : samba-4.8.3-4.el7.src.rpm
Build Date : Wed 31 Oct 2018 06:33:48 AM CST
Build Host : x86-01.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://www.samba.org/
Summary : Server and Client software to interoperate with Windows machines
Description :
Samba is the standard Windows interoperability suite of programs for Linux and
Unix.
启动samba服务
# service smb start
Redirecting to /bin/systemctl start smb.service
创建存放数据路径
# mkdir -p /samba/data
# chmod -R /samba/data
编辑配置文件
# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
# vi /etc/samba/smb.conf
# cat /etc/samba/smb.conf
[global]
workgroup = SAMBA
security = user
map to guest = Bad User
[Sharedfiles]
comment = sharedfiles
path = /samba/data
writable = yes
browseable = yes
guest ok = yes
验证配置文件并重启samba服务
# testparm -v
# service smb restart
Redirecting to /bin/systemctl restart smb.service
验证
在“运行”输入栏中输入服务器地址“\\172.16.60.102”后点击“确定”进行访问共享目录。
可以看到“Sharedfiles”共享文件夹。
双击文件夹进入后创建一个测试TXT文件验证是否具有写权限,如下图验证通过。
Tank
2019.7.26