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,信息服务块)是一种在局域网上共享 ...
随机推荐
- handsontable整理
hansontable简介 hansontable是一个在线类似Excel的表格编辑器,支持丰富的展现和交互,有多样的单元格类型供配置. 核心是由原生JavaScript构建,充分模块化,支持自定义b ...
- Lightoj 1024 - Eid
求n个数的最小公倍数. import java.math.*; import java.io.*; import java.util.*; import java.text.*; public cla ...
- 【转】Google 发布 Android 性能优化典范(比较老,但很实用)
2015年伊始,Google发布了关于Android性能优化典范的专题, 一共16个短视频,每个3-5分钟,帮助开发者创建更快更优秀的Android App.课程专题不仅仅介绍了Android系统中有 ...
- 创建cell的三种方式
方式一 注册cell -> 无需为cell绑定标识符 [使用UIViewController完成!] l 1> static NSString * const ID = @"c ...
- 七.OC基础加强--1.内存管理 2.野指针,内存泄露 3.set方法的内存管理 4.@property参数 5.@class和循环retain的使用 6.NSString的内存管理
1,内存管理简单介绍 1,为什么要有内存管理? malloc selloc dealloc```需要回头复习 一般的内存 4s 是512m内存:6 是1024m内存: 当内存过大时,会耗尽内存.出现程 ...
- 洛谷 P1315 观光公交 —— 贪心
题目:https://www.luogu.org/problemnew/show/P1315 问题是想不明白改动一条边会对后面造成怎样的影响: 实际上影响的会是一段,当某个车站出发时间受其来人牵制时, ...
- UI:用UITableView制作通讯录的关键代码
分析{功能分析(打电话.添加联系人.修改联系人),模块分析(联系人展示.详情模块.添加模块)} 拿到一个项目,首先分析项目框架(工程框架) 首先:判断是否是用户第一次安装:(如果是的,那就加载用户引导 ...
- (转)Repeater中增加序号自增列
<%# Convert.ToString(Container.ItemIndex+)%> 当Repeater空为时,提示没有数据... <FooterTemplate> < ...
- 461. Hamming Distance(汉明距离)
The Hamming distance between two integers is the number of positions at which the corresponding bits ...
- poj1419 求最大独立集
题目链接:http://poj.org/problem?id=1419 题意:求最大独立集 思路: 这里有一个定理: 最大独立集=补图的最大团最大团=补图的最大独立集 所以这里我们只要求给出的图的最大 ...