一,安装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 访问,输入上面设置密码即可。
 
 
 
 
 
 

最新文章

  1. 分布式系统之Quorum (NRW)算法
  2. [JAVA] java_实例 获得系统字体
  3. android studio 使用入门 (快捷键等收集)
  4. javascript代码注意事项
  5. 数据库表 copy
  6. C#编写的多生产者多消费者同步问题
  7. Windows 10正式版官方原版ISO镜像下载
  8. Contoso 大学 - 5 – 读取关联数据
  9. vs2010常用快捷方式
  10. as3 打开窗口类
  11. Oracle 取上周一到周末日期的查询语句
  12. TCP四次挥手
  13. ES6中的模块
  14. 基于FPGA的数字识别的实现
  15. Spring MVC 数据绑定 (四)
  16. php 文件压缩
  17. 一个exception
  18. python多线程同步机制Semaphore
  19. springcloud-01-介绍
  20. Python练习-无参装饰器的正确打开方式

热门文章

  1. python递归次数和堆栈溢出问题
  2. windows上自动设置java环境变量的脚本
  3. unity3d asset store下载的代码所在位置
  4. [chrome插件分享] gitlab-tree 更方便的浏览Gitlab上的代码
  5. 有助于提高你的 Web 开发技能的7个模式库
  6. [jQuery学习系列二 ]2-JQuery学习二-数组操作
  7. atitit.表单验证 的dsl 本质跟 easyui ligerui比较
  8. 在eclipse中安装freemarker插件及html使用freemarker编辑器
  9. untiy数据包的输出、加载和卸载
  10. android: permission和uses-permission