CentOS 7 samba server 配置
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 配置的更多相关文章
- Samba Server 配置
1.Issue:Server requested plaintext password but 'client plaintext auth' is disabled session setup ...
- ubuntu samba server 配置多用户访问
[share] path = /home/share/ writeable = yes browseable = yes create mask = directory mask = guest ok ...
- Centos 6 DNS Server 配置
安装bind yum install -y bind bind-chroot bind-utis 如果是Centos 5 # yum -y install bind caching-nameserve ...
- CentOS 7.2 安装配置Samba服务器
1背景 转Linux刚刚1年,vim操作还不能应对工程代码,之前一直都是Gnome桌面 + Clion 作开发环境,无奈在服务器上没有这样的环境, 看同事是(Windows)Source Insigh ...
- CentOS下Samba文件服务器的安装与配置
CentOS下Samba文件服务器的安装与配置 http://blog.csdn.net/limingzhong198/article/details/22064801 一.安装配置 1. 安装sam ...
- Centos samba 服务配置
1背景 转到Linux有段时间了,vim操作还不能应对工程代码,之前一直都是Gnome桌面 + Clion 作开发环境,无奈在服务器上没有这样的环境, 看同事是(Windows)Source Insi ...
- 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 ...
- centOS下yum安装配置samba
centOS下yum安装配置samba 2010-03-29 15:46:00 标签:samba yum centOS 安装 休闲 注意:本文的原则是只将文件共享应用于内网服务器,并让将要被共享的目 ...
- centos安装samba服务和配置
1.samba简介 Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成.SMB(Server Messages Block,信息服务块)是一种在局域网上共享 ...
随机推荐
- Spring Boot Spring 自动配置
Spring Boot 不是应用服务器: Spring Boot没有实现诸如JPA.JMS(Java Message Service)之类的Java企业级规范: Spring Boot没有引入任何形式 ...
- camera shading比例
-- ---- vendor/mediatek/proprietary/custom/mt6735/hal/D2/camera_3a/isp_tuning_custom.cpp static MINT ...
- POJ2594 Treasure Exploratio —— 最小路径覆盖 + 传递闭包
题目链接:https://vjudge.net/problem/POJ-2594 Treasure Exploration Time Limit: 6000MS Memory Limit: 655 ...
- HDU - 2586 How far away ?(离线Tarjan算法)
1.给定一棵树,每条边都有一定的权值,q次询问,每次询问某两点间的距离. 2.这样就可以用LCA来解,首先找到u, v 两点的lca,然后计算一下距离值就可以了. 这里的计算方法是,记下根结点到任意一 ...
- JSOI2010 联通数
传送门 这道题的题目描述看起来很奇怪.实际上的意思是要求在这个有向图之内能到达的点对有多少,解释一下题里的图片就是(1,1),(1,2),(1,3),(1,4),(1,5),(2,2),(2,3),( ...
- codeforces 447 A-E div2 补题
A DZY Loves Hash 水题 #include<iostream> #include<cstdio> #include<cstdlib> #include ...
- Rails 浅谈 ActiveRecord 的 N + 1 查询问题(copy)
[说明:资料来自https://ruby-china.org/topics/32364] ORM框架的性能小坑 在使用ActiveRecord这样的ORM工具时,常会嵌套遍历model.例如,有两个m ...
- Scanner类nextLine()和next()的区别和使用方法
next()一定要读取到有效字符后才可以结束输入,对输入有效字符之前遇到的空格键.Tab键或Enter键等结束符,next()方法会自动将其去掉,只有在输入有效字符之后,next()方法才将其后输入的 ...
- String类的直接赋值和构造方法赋值的区别
直接赋值:只开辟一块堆内存空间,而且保存的字符串可以自动入池,以供其他内容相同的字符串对象使用. 构造方法:开辟两块堆内存空间,有一块成为垃圾,并且字符串的内容无法自动入池,但是可以使用String类 ...
- cardboard sdk for unity 系统分析 - 对像与类
一.cardboard通过monobehavior派生的脚本组件与UNITY3D联系起来: 二.相关的类及其关系如下图: