samba是linux上的文件共享服务软件,相当与Windows上的共享文件夹,当然也是要在同一网段上的。

当前用的版本是4.4.4,好吧!下面介绍怎么去安装配置它,here we go!

1. 安装:

[root@localhost ~]# yum install samba samba-client samba-common

2. 创建可访问的用户:

[root@localhost SMBShare]# groupadd smbgrp   --> 创建一个可访问的用户组smbgrp

[root@localhost SMBShare]# useradd -G smbgrp smbtest   --> 创建一个用户并把他加入到smbgrp组中

[root@localhost SMBShare]# smbpasswd -a smbtest       --> 把这个用户添加到samba的访问列表中
New SMB password:
Retype new SMB password:
Added user smbtest.

3. 创建共享目录:

[root@localhost ~]# mkdir /home/SMBShare/    -->创建共享目录SMBShare

[root@localhost SMBShare]# chmod -R 0777 /home/SMBShare/  -->把目录的读写权限更改成可读写执行

[root@localhost SMBShare]# chown -R smbtest:smbgrp /home/SMBShare/  -->把文件拥有者改为smbtest账户和smbgrp组

[root@localhost SMBShare]# chcon -t samba_share_t /home/SMBShare/  -->允许匿名用户可访问上传文件

4. 修改配置文件smb.conf 并保存:

先把原来的配置文件备份一下

cp /etc/samba/smb.conf  /etc/samba/smb.conf.bak

然后编辑配置文件

vi /etc/samba/smb.conf

[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = centos
security = user
map to guest = bad user
dns proxy = no

[mobile]
path = /home/SMBShare
valid users = @smbgrp
guest ok = no
writeable = yes
browsable = yes

5. 启用服务:

systemctl restart smb.service

6. 防火墙设置:

因为我仅仅是为了实验所以就把防火墙关掉了 #systemctl disable firewalld.service

当然也可以设置例外 #firewall-cmd --permanent --zone=public --add-service=samba

重新加载防火墙 #firewall -cmd --reload

6. 访问测试:

在windows上输入 \\ip地址, 然后输入帐号:smbtest 密码:*********

tip:

设置匿名共享:

mkdir /samba/anonymous

chown -R  nobody:nobody /samba/anonymous

chmod -R 0755 /samba/anonymous

chcon -t samba_share_t /samba/anonymous

smb.conf文件中加入以下字段:

[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = centos
security = user
map to guest = bad user
dns proxy = no

[Anonymous]
path = /samba/anonymous
browsable =yes
writable = yes
guest ok = yes
read only = no

CentOS 7 samba server 配置的更多相关文章

  1. Samba Server 配置

    1.Issue:Server requested plaintext password but 'client plaintext auth' is disabled   session setup ...

  2. ubuntu samba server 配置多用户访问

    [share] path = /home/share/ writeable = yes browseable = yes create mask = directory mask = guest ok ...

  3. Centos 6 DNS Server 配置

    安装bind yum install -y bind bind-chroot bind-utis 如果是Centos 5 # yum -y install bind caching-nameserve ...

  4. CentOS 7.2 安装配置Samba服务器

    1背景 转Linux刚刚1年,vim操作还不能应对工程代码,之前一直都是Gnome桌面 + Clion 作开发环境,无奈在服务器上没有这样的环境, 看同事是(Windows)Source Insigh ...

  5. CentOS下Samba文件服务器的安装与配置

    CentOS下Samba文件服务器的安装与配置 http://blog.csdn.net/limingzhong198/article/details/22064801 一.安装配置 1. 安装sam ...

  6. Centos samba 服务配置

    1背景 转到Linux有段时间了,vim操作还不能应对工程代码,之前一直都是Gnome桌面 + Clion 作开发环境,无奈在服务器上没有这样的环境, 看同事是(Windows)Source Insi ...

  7. centos samba/squid 配置 samba配置 smbclient mount fstab自动挂载samba curl -xlocalhost:3128 www.qq.com squid配置 3128 DNSPOD 第二十七节课

    centos  samba/squid 配置  samba配置 smbclient  mount fstab自动挂载samba curl -xlocalhost:3128 www.qq.com squ ...

  8. centOS下yum安装配置samba

     centOS下yum安装配置samba 2010-03-29 15:46:00 标签:samba yum centOS 安装 休闲 注意:本文的原则是只将文件共享应用于内网服务器,并让将要被共享的目 ...

  9. centos安装samba服务和配置

    1.samba简介 Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成.SMB(Server Messages Block,信息服务块)是一种在局域网上共享 ...

随机推荐

  1. mac系统下显示隐藏文件

    在终端上输入以下命令即可: 显示隐藏文件命令: defaults write com.apple.finder AppleShowAllFiles -bool true 不显示隐藏文件命令: defa ...

  2. 并不对劲的LCT

    LCT,是连猫树(link-cat-tree)的缩写.它是树链剖分和splay的结合版本. 由于有很多关于LCT的文章以及这并不是对劲的文章,并不对劲的人并不打算讲得太详细. 推荐:详细的LCT-&g ...

  3. 【Codeforces 915E】 Physical Education Lessons

    [题目链接] 点击打开链接 [算法] 线段树,注意数据量大,要动态开点 [代码] #include<bits/stdc++.h> using namespace std; ; ,root ...

  4. Python+页面元素高亮源码实例

    简单写了一个页面元素高亮的方法,原理就是在python中调用js实现元素高亮,分享一下源码如下: 1.元素高亮源码 Js调用 js = "var q=document.getElementB ...

  5. poj 3311(DP + 状态压缩)

    Hie with the Pie Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 5205   Accepted: 2790 ...

  6. bzoj 4849: [Neerc2016]Mole Tunnels【模拟费用流】

    参考:https://www.cnblogs.com/CQzhangyu/p/6952371.html 费用流很简单,考虑但是会T. 考虑费用流的本质,流一次需要要找一个能够从当前点到达的距离最小的点 ...

  7. bzoj 3205: [Apio2013]机器人【dfs+斯坦纳树+spfa】

    第一次听说斯坦纳树这种东西 先dfs预处理出来dis[i][j][k]表示格子(i,j)向k方向转移能到哪,记忆话搜索预处理,注意如果有环的话特判一下 设f[i][j][x][y]表示复合机器人i-j ...

  8. poj 1474 Video Surveillance 【半平面交】

    半平面交求多边形的核,注意边是顺时针给出的 //卡精致死于是换(?)了一种求半平面交的方法-- #include<iostream> #include<cstdio> #inc ...

  9. Keras 文档阅读笔记(不定期更新)

    目录 Keras 文档阅读笔记(不定期更新) 模型 Sequential 模型方法 Model 类(函数式 API) 方法 层 关于 Keras 网络层 核心层 卷积层 池化层 循环层 融合层 高级激 ...

  10. mysql查询流程

    首先是连接器 连接器负责跟客户端来链接 链接成功后 mysql会先去查询缓存,之前是不是有查询的这条语句,之前执行过的话 就会以key-value的形式缓存到内存中,如果没有就会继续执行后面的,执行完 ...