SAMBA服务配置-更新中

来源:互联网 发布:99是什么意思网络用语 编辑:程序博客网 时间:2024/06/08 11:56

1、检查当前系统是否安装samba套件 rpm -qa |grep samba

      samba-common-2.2.7a-7.9.0

      samba-client-2.2.7a-7.9.0

      samba-2.2.7a-7.9.0

2、samba配置文件

/etc/samba/smb.conf

/etc/samba/smbpasswd

3、samba执行文件

samba服务器执行文件有testparm,smbd,nmbd,和smbpasswd.

samba客户端的执行文件有smbmount ,smbclient

4、samba的相关目录

/usr/share/doc/samba 此目录包含有samba服务器相关的所有技术手册

/var/log/samba 此目录是samba预设的登陆文件所在目录

/usr/share/samba/codepages 这个目录里面放的是各种语言的支持格式。如要支持中文显示,要将codepage.936这个文件放置在此目录下。

/etc/samba 配置文件所在目录。

5、配置SAMBA服务器

A、SAMBA最重要的配置文件是/etc/samba/smb.conf

此文件中[global]-[homes]之间为全局设定;

[homes]设定的是共享目录。

配置文件功能说明很详细,英文也不是特别深,对着在线翻译软件您应该可以看懂的。

#======================= Global Settings =====================================

[global]

# ----------------------- Network Related Options -------------------------网络选项

       workgroup = MYGROUP//定义服务器工作组
        server string = Samba Server Version %v//服务器描述可与SAMBA设定的变量配合使用

;       netbios name = SAMBA//服务器在网络中的名称

;       interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24//定义服务器网络接口
;       hosts allow = 127. 192.168.0. 192.168.5.  //允许访问共享网络的地址和主机地址

# --------------------------- Logging Options -----------------------------登陆选项

        # logs split per machine
;       log file = /var/log/samba/%m.log//指定日志目录与文件 存放位置
        # max 50KB per log file, then rotate
;       max log size = 50//日志大小限制 0为不限制单位KB

# ----------------------- Standalone Server Options ------------------------脱机服务选项

        security = user//安全级别
        passdb backend = tdbsam//密码后台文件
# ----------------------- Domain Members Options -----------------------主机域成员选项
;       security = domain//安全级别
;       passdb backend = tdbsam//密码后台文件
;       realm = MY_REALM//范围

;       password server = <NT-Server-Name>//密码服务器

# ----------------------- Domain Controller Options ------------------------主机域控制选项

;       security = user//安全级别
;       passdb backend = tdbsam //密码后台文件

;       domain master = yes//主域可连接
;       domain logons = yes//域登陆

        # the login script name depends on the machine name//登陆日志取决于登陆机器名
;       logon script = %m.bat//登陆脚本
        # the login script name depends on the unix user used//登陆日志依赖于登陆用户名
;       logon script = %u.bat//用户登陆脚本
;       logon path = \\%L\Profiles\%u//用户登陆路径
        # disables profiles support by specifing an empty path//机器标识一个不可用的空路径
;       logon path =

;       add user script = /usr/sbin/useradd "%u" -n -g users//新增用户脚本
;       add group script = /usr/sbin/groupadd "%g"//新增用用户组脚本
;       add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s /bin/false "%u"//新增用户机器脚本
;       delete user script = /usr/sbin/userdel "%u"//删除用户脚本
;       delete user from group script = /usr/sbin/userdel "%u" "%g"//删除用户组所属用户脚本
;       delete group script = /usr/sbin/groupdel "%g"//删除用户脚本

# ----------------------- Browser Control Options ----------------------------//浏览控制选项

;       local master = no//本地管理
;       os level = 33//系统级别
;       preferred master = yes//首选主要的

#----------------------------- Name Resolution -------------------------------//关系名

;       wins support = yes//WINS服务支持
;       wins server = w.x.y.z//WINS服务器
;       wins proxy = yes//WINS支持代理服务器

;       dns proxy = yes//DNS支持代理服务器

# --------------------------- Printing Options -----------------------------//打印选项

        load printers = yes//本地打印
        cups options = raw//打印池选项

;       printcap name = /etc/printcap
        #obtain list of printers automatically on SystemV
;       printcap name = lpstat
;       printing = cups

# --------------------------- Filesystem Options ---------------------------//文件系统选项

;       map archive = no//映射规则存档
;       map hidden = no
;       map read only = no
;       map system = no
;       store dos attributes = yes
#============================ Share Definitions ==============================

到此为止服务器的全局配置结束。接下来就是设定共享目录了。

[homes]

        comment = Home Directories//对共享文件的注释说明
        browseable = no//防止用户浏览其他用户文件
        writable = yes//可写入
;       valid users = %S//可用的用户名
;       valid users = MYDOMAIN\%S

[printers]
        comment = All Printers//打印说明
        path = /var/spool/samba//打印缓冲路径
        browseable = no
        guest ok = no//来宾用户可使用打印机
        writable = no//共享目录不允许写操作
        printable = yes//可打印共享

# Un-comment the following and create the netlogon directory for Domain Logons
;       [netlogon]
;       comment = Network Logon Service
;       path = /var/lib/samba/netlogon
;       guest ok = yes
;       writable = no
;       share modes = no

# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;       [Profiles]
;       path = /var/lib/samba/profiles
;       browseable = no
;       guest ok = yes
# A publicly accessible directory, but read only, except for people in
# the "staff" group
;       [public]  //共享文件名
;       comment = Public Stuff
;       path = /home/samba//共享目录
;       public = yes
;       writable = yes
;       printable = no
;       write list = +staff //可写入权限用户组


 


 


 

 


 


 


 


 


 


 

 

原创粉丝点击