一,安装samba4

不要直接 yum install samba ,默认安装的是samba3版本,但这个版本有问题(open_rpc_pipe_p: copy_serverinfo failed这个错误)
 
所以这里安装samba4 版本
//查看源
[root@yohuu14 samba]# yum list samba*.*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: centos.ustc.edu.cn
 * updates: mirrors.163.com
Installed Packages
samba4.x86_64                                                                                                              4.0.0-66.el6_6.rc4                                                                                         @base  
samba4-client.x86_64                                                                                                       4.0.0-66.el6_6.rc4                                                                                         @base  
samba4-common.x86_64                                                                                                       4.0.0-66.el6_6.rc4                                                                                         @base  
samba4-libs.x86_64                                                                                                         4.0.0-66.el6_6.rc4                                                                                         @base  
samba4-winbind.x86_64                                                                                                      4.0.0-66.el6_6.rc4                                                                                         @base  
samba4-winbind-clients.x86_64                                                                                              4.0.0-66.el6_6.rc4                                                                                         @base  
Available Packages
samba.x86_64                                                                                                               3.6.23-21.el6_7                                                                                            updates
samba-client.x86_64                                                                                                        3.6.23-21.el6_7                                                                                            updates
samba-common.i686                                                                                                          3.6.23-21.el6_7                                                                                            updates
samba-common.x86_64                                                                                                        3.6.23-21.el6_7                                                                                            updates
samba-doc.x86_64                                                                                                           3.6.23-21.el6_7                                                                                            updates
samba-domainjoin-gui.x86_64                                                                                                3.6.23-21.el6_7                                                                                            updates
samba-glusterfs.x86_64                                                                                                     3.6.23-21.el6_7                                                                                            updates
samba-swat.x86_64                                                                                                          3.6.23-21.el6_7                                                                                            updates
samba-winbind.x86_64                                                                                                       3.6.23-21.el6_7                                                                                            updates
samba-winbind-clients.i686                                                                                                 3.6.23-21.el6_7                                                                                            updates
samba-winbind-clients.x86_64                                                                                               3.6.23-21.el6_7                                                                                            updates
samba-winbind-devel.i686                                                                                                   3.6.23-21.el6_7                                                                                            updates
samba-winbind-devel.x86_64                                                                                                 3.6.23-21.el6_7                                                                                            updates
samba-winbind-krb5-locator.x86_64                                                                                          3.6.23-21.el6_7                                                                                            updates
samba4-dc.x86_64                                                                                                           4.0.0-66.el6_6.rc4                                                                                         base   
samba4-dc-libs.x86_64                                                                                                      4.0.0-66.el6_6.rc4                                                                                         base   
samba4-devel.x86_64                                                                                                        4.0.0-66.el6_6.rc4                                                                                         base   
samba4-pidl.x86_64                                                                                                         4.0.0-66.el6_6.rc4                                                                                         base   
samba4-python.x86_64                                                                                                       4.0.0-66.el6_6.rc4                                                                                         base   
samba4-swat.x86_64                                                                                                         4.0.0-66.el6_6.rc4                                                                                         base   
samba4-test.x86_64                                                                                                         4.0.0-66.el6_6.rc4                                                                                         base   
samba4-winbind-krb5-locator.x86_64                                                                                         4.0.0-66.el6_6.rc4                     
 
[root@yohuu14 samba]# yum install -y samba4
 
[root@yohuu14 samba]# yum install -y samba4-winbind.x86_64 samba4-client.x86_64 samba4-winbind-clients.x86_64 
 
[root@yohuu14 samba]# rpm -qa|grep samba
samba4-winbind-clients-4.0.0-66.el6_6.rc4.x86_64
samba4-client-4.0.0-66.el6_6.rc4.x86_64
samba4-libs-4.0.0-66.el6_6.rc4.x86_64
samba4-4.0.0-66.el6_6.rc4.x86_64
samba4-winbind-4.0.0-66.el6_6.rc4.x86_64
samba4-common-4.0.0-66.el6_6.rc4.x86_64
 
 
二,设置防火墙
 
-A INPUT -m state --state NEW -m tcp -p tcp --dport 137 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
三,授权共享权限 
 
useradd operate
 
smbpasswd -a  operate //添加smb登录用户并设置密码(注意系统中必须存在相同的用户名)
 
smbpasswd -x  operate //删除
 
[root@yohuu14 samba]# cat smb.conf
[global]
server string = Samba Server
dos charset = GB2312
unix charset = GB2312
display charset = GB2312
security = share
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
 
[share]
public = yes
path = /home/samba/share   //无密码即可访问可以设置 chown nobody.nobody /home/samba/share 和 chmod 777 /home/samba/share
 
[operate]
workgroup = operate
netbios name= operate
path = /home/samba/operate  //chown operate.operate /home/samba/share 和 chmod 777 /home/samba/operate
browseable = yes
writeable = yes
 
 
四,重启服务
service smb restart
 
windows 中
运行cmd 中//IP 访问,输入上面设置密码即可。
 
 
 
 
 
 

samba 服务器的搭建的更多相关文章

  1. 自学linux——20.Samba服务器的搭建

    Samba服务器的搭建 一.Samba的认识 1.Samba是一个能让Linux系统应用Microsoft网络通讯协议的软件 2.Samba不仅用于Linux与windows系统直接的文件共享和打印共 ...

  2. Linux samba服务器的搭建

    目录 1. 安装samba 2. 配置smb.conf 3. 创建samba登陆用户 4. 创建samba共享文件夹 5. 重启samba服务 6. 访问samba共享文件夹 7. 参考资料 1. 安 ...

  3. Red Hat 6.5 Samba服务器的搭建(登录访问)

    搭建Samba服务器是为了实现Linux共享目录之后,在Windows可以直接访问该共享目录. 现在介绍如何在红帽6.5系统中搭建Samba服务. 搭建Samba服务之前,yum源必须配置好,本地源和 ...

  4. Red Hat 6.5 Samba服务器的搭建(匿名访问,免登录)

    搭建Samba服务器是为了实现Linux共享目录之后,在Windows可以直接访问该共享目录. 现在介绍如何在红帽6.5系统中搭建Samba服务. 搭建Samba服务之前,yum源必须配置好,本地源和 ...

  5. samba服务器的搭建及使用

    一.Samba服务器的安装及配置 1.samba服务器的安装 rpm –ivh /mnt/Packages/samba-3. 5. 10-125. el6.i686.rpm 需要挂载红帽6的光盘 2. ...

  6. Linux中samba服务器的搭建

    使用的vmware12虚拟机安装的centos6.8和物理机上的windows10,实现在windows10 上访问CentOs上的samba服务. 一.先查看系统中是否安装有samba服务相关的软件 ...

  7. samba服务器的搭建和配置

    案例: 公司有两个部门, sales / market . 分别有成员 jack / tom 和 zhang / shen . 公司需求是这样的, 本部门资料禁止其他部门访问, 本部门成员之间不能干扰 ...

  8. samba服务器的搭建和用户权限,文件夹权限设置

    一.简介:samba服务是基于netbios  安装: 通过yum安装 [root@localhost ~]# yum install samba samba-client samba-swat 查看 ...

  9. CentOS 6.7下 Samba服务器的搭建与配置(share共享模式)

    https://www.linuxidc.com/Linux/2016-12/138220.htm

随机推荐

  1. OpenGL(二)——函数库简述

    简述 1. OpenGL用到的库分为OpenGL核心库.OpenGL实用库.OpenGL辅助库和OpenGL工具库(不是必须) 2. OpenGL核心库 核心库包含有115个函数,函数名的前缀为gl ...

  2. linux增加根分区大小

    以下操作以root身份运行 1.增加一个新分区(从原有硬盘分,或增加一个新硬盘并进行分区fdisk)  格式化成ext4(mkfs.ext4 /dev/sdb1,假设为/dev/sdb1) 2.将新的 ...

  3. 安装SQL Server 2008 R2 Enterprise错误:'' is not a valid login or you do not have permission

    今天安装SQL Server时遇到一个恶心的Bug. ------------------------------------------------------------------------- ...

  4. 《Linux内核设计与实现》读书笔记(十四)- 块I/O层

    最近太忙,居然过了2个月才更新第十四章.... 主要内容: 块设备简介 内核访问块设备的方法 内核I/O调度程序 1. 块设备简介 I/O设备主要有2类: 字符设备:只能顺序读写设备中的内容,比如 串 ...

  5. 使用 Microsoft Fakes 进行单元测试

    本文为 Dennis Gao 原创技术文章,发表于博客园博客,未经作者本人允许禁止任何形式的转载. 在编写单元测试时,我们会遇到不同的外部依赖项,大体上可以分为两类: 依赖于接口或抽象类 依赖于具体类 ...

  6. PC-PC-单片机(Arduino)通信实例

    请仔细理解相关参数,如端口设置.IP设置.COM口设置......等等.....不要盲目COPY.....这涉及2台电脑和一个单片机,其中一台电脑作为服务器并与单片机相连,负责通过网络与客户端通信(s ...

  7. weblogic jetty debug 远程

  8. 【Android】AppCompat V21:将 Materia Design 兼容到5.0之前的设备

    AppCompat V21:将 Materia Design 兼容到于5.0之前的设备 本篇文章翻译自Chris Banes(就职于Google,是Android-PullToRefresh,Phot ...

  9. paip.java OutOfMemoryError 解决方法o33

    paip.java OutOfMemoryError 解决方法o33 java.lang.OutOfMemoryError: Requested # java.lang.OutOfMemoryErro ...

  10. iOS-App生命周期

    iOS APP 生命周期   官方文档: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneO ...