实验要求:

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

  

最新文章

  1. 【JavaScript】详解JSON
  2. Redis学习笔记(4) Redis事务、生存时间及排序
  3. ThreadLocal之我见
  4. 2016.8.14安装myplayer心得
  5. unity3D 搞定任意ios插件
  6. 杀死进程 kill -9
  7. vmware ubuntu14.04虚拟机不能正常拷贝文件到windows且不能自适应虚拟机屏幕窗口自动变化的解决办法
  8. 瘸腿蛤蟆笔记29-cocos2d-x-3.2 Box2d物理引擎dynamics模块介绍
  9. CodeForces 415D Mashmokh and ACM
  10. 5-jQuery - AJAX get()/post()页面请求即执行
  11. 谨慎能捕千秋蝉(三)——界面操作劫持与HTML5安全
  12. Hadoop集群时间同步
  13. linkin大话数据结构--字符串,数组,list之间的互转
  14. apache kafka技术分享系列(目录索引)
  15. ConcurrentHashMap中的putIfAbsent方法的使用以及返回值的含义
  16. HikariCP和spring-boot-devtools了解
  17. Spring对Bean装配详解
  18. virt-install详解
  19. oracle中斜杠(/)的含义
  20. gdoi2017

热门文章

  1. 超详细思路讲解SQL语句的查询实现,及数据的创建。
  2. git push 到 github
  3. 多个jar包合并成一个jar包(ant)
  4. 解决java编译错误:编码 GBK 的不可映射字符 (0x8C)
  5. 第二章 Vue快速入门-- 28 自定义按键修饰符
  6. POJ1185炮兵阵地(DP状态压缩)
  7. 【Layui】当Layui数据表格和Layui下拉框组合时发生的问题
  8. c# 判断某个类是否实现某个接口
  9. css设置元素垂直居中的几个方法
  10. vscode存盘时格式化