码迷,mamicode.com
首页 > 其他好文 > 详细

部署Samba共享

时间:2016-08-04 19:23:41      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:

一、           实验步骤及结果

第一阶段

                                                        部署Samba共享

 

Hostname

OS

IP

Software

Sambasvr

 

CentOS-6.3

10.0.0.63

yum install –y samba

 

关闭防火墙:service iptables stop

配置Samba服务

[root@Sambasvr /]# yum install –y samba                                                    //安装Samba软件包

[root@Sambasvr /]# cp -p /etc/samba/smb.conf /etc/samba/smb.conf.bak  //备份主配置文件

[root@Sambasvr /]# grep -v "#" /etc/samba/smb.conf.bak |grep -v "^$" |grep -v "^;" > /etc/samba/smb.conf

              //过滤注释性信息

[root@Sambasvr ~]# useradd xuhao                                                             //添加用户

[root@Sambasvr ~]# smbpasswd –a xuhao                                                    //添加为smb用户

[root@Sambasvr ~]# vim /etc/samba/smbusers                                              //为用户添加映射名

# Unix_name = SMB_name1 SMB_name2 ...

root = administrator admin

nobody = guest pcguest smbguest

xuhao = admin

[root@Sambasvr ~]# mkdir /share                                                               //创建共享文件夹

[root@Sambasvr ~]# mkdir /public

[root@Sambasvr ~]# vim /etc/samba/smb.conf                                              //修改主配置文件

[global]

        workgroup = WORKGROUP                                   //修改工作组

        server string = Samba Server Version %v

        log file = /var/log/samba/log.%m

        max log size = 50

        security = share                                                       //安全级别为共享

        passdb backend = tdbsam

        load printers = yes

        cups options = raw

        username map = /etc/samba/smbusers                        //映射名称文件路径

 

[homes]

        comment = Home Directories

        browseable = no

        writable = yes

 

[printers]

        comment = All Printers

        path = /var/spool/samba

        browseable = no

        guest ok = no

        writable = no

        printable = yes

 

[xuhao]

        path = /share                                                           //共享路径

        public = no                                                             //不公开

        write = yes                                                             //可写权限

        valid users = admin                                                 //认证用户 admin

 

[public]

        path = /public

        public = yes

               read only = yes

启动Samba服务

[root@Sambasvr /]# service smb start

Starting SMB services:                                     [  OK  ]

 

登录客户端验证

部署Samba共享

标签:

原文地址:http://www.cnblogs.com/baishuchao/p/5737849.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!