Samba | 通过SAMBA服务共享Linux文件夹

目录

版本说明

安装配置SAMBA服务

验证


版本说明

       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

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值