阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Linux搭建Samba共享服务器

132次阅读
没有评论

共计 2031 个字符,预计需要花费 6 分钟才能阅读完成。

实验要求:

Samba 文件共享服务配置与访问,配置访问用户以及相应权限。

Tips: 创建共享目录 /test 和 /share,并且分别在 /test 下创建文件 tf1(只读)tf2(读写)  在 /share 下创建文件 pf1(只读) 和 pf2(读写)

1、挂载本地 yum 源

[root@localhost /]# mkdir /media/cdrom

[root@localhost /]# mount /dev/cdrom  /media/cdrom/

[root@localhost /]# vim /etc/yum.repos.d/rhel-source.repo

rhel-source]

name=Red Hat Enterprise Linux $releasever – $basearch – Source

baseurl=file:///media/cdrom

enabled=1

2、关闭 Selinux 和 IPtables

[root@localhost /]# vim /etc/selinux/config    // 路径

[root@localhost /]# setenforce 0    // 临时关闭 Selinux

[root@localhost /]# /etc/init.d/iptables  stop    // 关闭防火墙

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    // 开启服务  测试

———————————— 分割线 ————————————

如何在 Ubuntu 14.04 中使用 Samba 共享文件  http://www.linuxidc.com/Linux/2014-07/104894.htm

VMWare 虚拟机 Ubuntu 双网卡 访问 samba 速度 翻倍 http://www.linuxidc.com/Linux/2013-06/85445.htm

Samba 文件共享服务器加入 Windows Server 2003 域 http://www.linuxidc.com/Linux/2013-06/86391.htm

Samba 安装配置 http://www.linuxidc.com/Linux/2013-06/86101.htm

CentOS 6.2 下 Samba 服务的配置 http://www.linuxidc.com/Linux/2013-01/78390.htm

Samba 服务器安装和配置  http://www.linuxidc.com/Linux/2014-12/110459.htm

Win7+VMware+Fedora18 Samba 服务器的搭建图解 http://www.linuxidc.com/Linux/2013-01/78234.htm

———————————— 分割线 ————————————

Samba 的详细介绍 :请点这里
Samba 的下载地址 :请点这里

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-05/130901.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计2031字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中