1.简介

Samba是一套使用SMB(Server Message Block)协议的应用程序, 通过支持这个协议, Samba允许Linux服务器与Windows系统之间进行通信,使跨平台的互访成为可能。

2.系统环境

系统版本:centos6.7

  服务器IP: 10.220.5.166/24

3.关闭安全服务

[root@ken ~]# service iptables stop
[root@ken ~]# setenforce

4. 安装samba

[root@ken ~]# yum install samba -y

5.配置samba

[root@ken ~]# vim /etc/samba/smb.conf
...
# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwar ds
# compatibility. tdbsam requires no further configuration. security = share #101行处修改安全级别为share
passdb backend = tdbsam # ----------------------- Domain Members Options ----------------- -------
#
# Security must be set to domain or ads
#
# Use the realm option only with security = ads
# Specifies the Active Directory realm the host is part of
...
....
#============================ Share Definitions ================== ============
[ken] #247行处添加如下代码,等号前后需要有空格
comment = ken
path = /ken #定义共享路径
writable = yes
public = yes

6.创建共享目录

[root@ken ~]# mkdir /ken

7.修改共享目录权限

[root@ken ~]# chmod -R  /ken

8.重启samba服务

[root@ken ~]# service smb restart
Shutting down SMB services: [FAILED]
Starting SMB services: [ OK ]

9.window访问

按回车键

10.写入数据测试

测试完成。

补充

由于centos7中安全级别已经不再支持share,因此安全级别必须为user.

1.系统环境

centos7.5

2.错误信息

[root@ken ~]# testparm /etc/samba/smb.conf
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max () to minimum Windows limit ()
WARNING: Ignoring invalid value 'share' for parameter 'security'
Error loading services.

3.故障排除

...
# passdb backend = the backend used to store user information in. New
# installations should use either tdbsam or ldapsam. No additional configuration
# is required for tdbsam. The "smbpasswd" utility is available for backwards
# compatibility.
# security = user #安全级别修改为user
passdb backend = tdbsam # ----------------------- Domain Members Options ------------------------
#
# security = must be set to domain or ads.
#
# passdb backend = the backend used to store user information in. New
# installations should use either tdbsam or ldapsam. No additional configuration
# is required for tdbsam. The "smbpasswd" utility is available for backwards
# compatibility.
...

4.创建用户

[root@ken ~]# useradd -r -s /sbin/nologin ken

5.创建管理共享资源的账户

[root@ken ~]# pdbedit -a -u ken
new password:
retype new password:
Unix username: ken
NT username:
Account Flags: [U ]
User SID: S-------
Primary Group SID: S-------
Full Name:
Home Directory: \\localhost\ken
...

6.重启服务

[root@ken ~]# systemctl restart smb

7.浏览器测试

输入账户和密码

测试成功!

samba企业级实战应用详解-技术流ken的更多相关文章

  1. iptables实战案例详解-技术流ken

    简介 关于iptables的介绍网上有很多的资料,大家可以自己找一些关于iptables的工作原理,以及四表五链的简介,对于学习iptables将会事半功倍.本博文将会例举几个工作中常用的iptabl ...

  2. NTP时间服务器实战应用详解-技术流ken

    简介 在搭建集群服务中,要保证各节点时间一致,NTP时间服务器就成为了一个好帮手了. 系统环境 系统版本:centos6.7 服务器IP:10.220..5.166/24 客户端IP:10.220.5 ...

  3. MySQL系列详解三:MySQL中各类日志详解-技术流ken

    前言 日志文件记录了MySQL数据库的各种类型的活动,MySQL数据库中常见的日志文件有 查询日志,慢查询日志,错误日志,二进制日志,中继日志 .下面分别对他们进行介绍. 查询日志 1.查看查询日志变 ...

  4. 实战!基于lamp安装wordpress详解-技术流ken

    简介 LAMP 是Linux Apache MySQL PHP的简写,其实就是把Apache, MySQL以及PHP安装在Linux系统上,组成一个环境来运行动态的脚本文件.现在基于lamp搭建wor ...

  5. KVM虚拟化使用详解--技术流ken

    KVM介绍 Kernel-based Virtual Machine的简称,是一个开源的系统虚拟化模块,自Linux 2.6.20之后集成在Linux的各个主要发行版本中. KVM的虚拟化需要硬件支持 ...

  6. cobbler批量安装系统使用详解-技术流ken

    前言 cobbler是一个可以实现批量安装系统的Linux应用程序.它有别于pxe+kickstart,cobbler可以实现同个服务器批量安装不同操作系统版本. 系统环境准备及其下载cobbler ...

  7. xshell连接虚拟机详解--技术流ken

    xshell连接虚拟机 第一步:网络模式更改为桥接模式 第二步:重启网络 [root@ken1 ~]# systemctl restart network 第三步:获取IP地址 输入命令ip a 第四 ...

  8. grafana使用详解--技术流ken

    grafana简介 Grafana是一个跨平台的开源的度量分析和可视化工具,可以通过将采集的数据查询然后可视化的展示,并及时通知.它主要有以下六大特点: 1.展示方式:快速灵活的客户端图表,面板插件有 ...

  9. MySQL系列详解五: xtrabackup实现完全备份及增量备份详解-技术流ken

    xtrabackup简介 xtrabackup是一个用来对mysql做备份的工具,它可以对innodb引擎的数据库做热备.xtrabackup备份和还原速度快,备份操作不会中断正在执行的事务,备份完成 ...

随机推荐

  1. SimpleCursorAdapter使用代码

    package com.kale.cursoradapter; import android.app.Activity; import android.database.Cursor; import ...

  2. java面试一、1.3线程与进程

    免责声明:     本文内容多来自网络文章,转载为个人收藏,分享知识,如有侵权,请联系博主进行删除. 1.3.进程和线程 线程和进程的概念.并行和并发的概念 线程和进程: 线程:是程序执行流的最小单元 ...

  3. idea 新建项目上传至git(coding)

    一.新建项目 1.改为git版本 2.出现如下框 选择Git 3.新建一个.gitignore file (Git) 4.勾掉一些不需要的 5.出现如下框 5.1.如果不知道.gitignore fi ...

  4. JS canvas 画板 撤销

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  5. 搭建servlet+jsp环境

    c3p0: <?xml version="1.0" encoding="UTF-8"?><c3p0-config> <named- ...

  6. Product and Sum in Category Theory

    Even if you are not a functional programmer, the notion of product type should be familiar to you, e ...

  7. Django项目配置日志

    LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format': ...

  8. 第二节:Web前端-ASP.NET之C#基础

    第二节:Web前端-ASP.NET之C#基础 学习ASP.NET,要掌握学习语言,控件等技能, <div style="text-align: center; line-height: ...

  9. 浅谈static关键字的四种用法

    1.修饰成员变量 在一个person类中,一个成员变量例如 String name,当new2个person()对象时候,这2个对象在堆的位置是不同的,给name赋值张三.李四,这两个对象的name是 ...

  10. Oracle列转行函数使用

    一.业务场景 今天需要实现一个table,有一列的效果是:用户姓名A(账号a),用户姓名B(账号b)...这种格式.这就想到oracle的列转行函数vm_concat. 可以用类似这种格式wm_con ...