centos 安装samba服务,挂载目录

方便在centos开发,安装samba

注意防火墙

安装

yum install samba samba-client samba-common -y

配置文件

vim /etc/samba/smb.conf
[global]                                                  //该设置与Samba服务整体运行环境有关,它的设置项目针对所有共享资源       

# ----------------------- Network Related Options -------------------------
#
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
#
# server string is the equivalent of the NT Description field
#
# netbios name can be used to specify a server name not tied to the hostname

        workgroup = WORKGROUP                             //定义工作组,也就是windows中的工作组概念
        server string = David Samba Server Version %v     //定义Samba服务器的简要说明
        netbios name = DavidSamba                         //定义windows中显示出来的计算机名称

# --------------------------- Logging Options -----------------------------
#
# Log File let you specify where to put logs and how to split them up.

        log file = /var/log/samba/log.%m                  //定义Samba用户的日志文件,%m代表客户端主机名
                                                          //Samba服务器会在指定的目录中为每个登陆主机建立不同的日志文件
# ----------------------- Standalone Server Options ------------------------
#
# Scurity can be set to user, share(deprecated) or server(deprecated)

        security = share                                  //共享级别,用户不需要账号和密码即可访问

#============================ Share Definitions ==============================

[homes]
        comment = Home Directories
        browseable = no
        public = yes
        writable = yes
        valid users = %S
; valid users = MYDOMAIN\%S

[public]
        comment = Public Stuff
        path = /home/share
        public = yes 

配置用户

sandy 为系统用户
smbpasswd -a sandy

重启及其他命令

/etc/init.d/smb restart
/etc/init.d/nmb restart
加入开机
 chkconfig --level 35 smb on
配置重载
service smb reload

测试配置文件
testparm

标签: centos, smaba

添加新评论