400-8014011
    资 讯
    您的位置:首页 >> 资 讯 >> LINUX应用 >> LINUX配置 >> 正文
    SAMBA每个用户对应单个帐号的配置

    点击:   发布日期:2012-09-11

    本文来自 www.020fix.com
    samba也许大家都不是非常熟悉,因为这事linux下的,现在教大家如何配置
    1.  设置samba目录
    mkdir /data/samba/design_image/hedan
    mkdir /data/samba/ design_image/tongzhuang
    2.  创建系统用户
    useradd –s /sbin/nologin ceo
    useradd –s /sbin/nologin hedan
    useradd –s /sbin/nologin tongzhuang
    3.  创建samba用户
    /usr/local/samba/bin/smbpasswd –a ceo
    /usr/local/samba/bin/smbpasswd –a hedan
    /usr/local/samba/bin/smbpasswd –a tongzhuang

    /usr/local/samba/bin/smbpasswd –d 禁用用户
    /usr/local/samba/bin/smbpasswd –x 删除用户
    4.  更改samba文件目录属组
    chgrp hedan /data/samba/design_image/hedan
    chgrp tongzhuang /data/samba/design_image/tongzhuang
    5.  更改samba文件目录的拥有者
    chown ceo /data/samba/design_image/hedan
    chown ceo /data/samba/design_image/tongzhuang
    6.  设置samba文件目录权限
    chmod 777 /data/samba/design_image/hedan
    chmod 777 /data/samba/design_image/tongzhuang
    7.  设置smb.conf用户配置文件
    cp /usr/local/samba/lib/smb.conf /usr/local/samba/lib/smb.conf.ceo
    cp /usr/local/samba/lib/smb.conf /usr/local/samba/lib/smb.conf.hedan
    cp /usr/local/samba/lib/smb.conf /usr/local/samba/lib/smb.conf.tongzhuang
    chmod 0600 /usr/local/samba/lib/smb.conf.*

    vi /usr/local/samba/lib/smb.conf.ceo
    [sxxl]
    path = /data/samba/pub
    comment = share allshare
    writeable = yes
    browseable = yes
    public = no
    valid users = ceo

    [design image]
    path = /data/samba/design_image
    comment = share desing_image team
    public = no
    writable = yes
    browseable = yes
    valid users = ceo

    vi /usr/local/smaba/lib/smb.conf.hedan
    [hedan]
    comment = sxxl share
    path = /data/samba/design_image/hedan
    writeable = yes
    valid users = hedan
    create mask = 0744
    directory mask = 0744

    vi /usr/local/smaba/lib/smb.conf.tongzhuang
    [tongzhuang]
    comment = sxxl share
    path = /data/samba/design_image/tongzhuang
    writeable = yes
    valid users = tongzhuang
    create mask = 0744
    directory mask = 0744

    8.  设置samba主配置文件
    vi /usr/local/samba/lib/smb.conf
    [global]
    workgroup = WORKGROUP
    netbios name = sxxl
    server string = sxxl share server
    load printers = no
    security = user
    smb passwd file = /usr/local/samba/private/smbpasswd
    include = /usr/local/samba/lib/smb.conf.%U

    vi smbstart.sh
    #!/bin/sh
    /usr/local/samba/sbin/nmbd –D -l/var/log/samba/smbd.log  -s/usr/local/samba/lib/smb.conf

    9.  重启samba服务
    ./smbstart.sh

    10.一定要开启samba端口和seliunx设置