Linux下Samba服务器的搭建

一、安装samba软件
    rpm -ivh samba-3.5.10-114.el6.x86_64.rpm
二、添加用户组和samba用户
    groupadd tech
    groupadd benet
    useradd -g tech techuser
    useradd -g benet -G tech benetuser
三、增加samba用户的密码
    smbpasswd -a root
    smbpasswd -a techuser
    smbpasswd -a benetuser
    pdbedit -L//查看情况
四、创建共享文件目录
    mkdir -p /var/share/public /var/share/training  /var/share/devel
五、更改文件的属主及其权限
    chown :benet /var/share/devel/
    chmod g+w /var/share/devel/
六、编辑配置文件 vi /etc/samba/smb.conf
    【在Domain Members Options前面编辑】
     security = share
     username map =/etc/samba/smbuser
     passdb   backend = tdbsam
    【在Share Definitions下面编辑】


[public]
        comment = Home Directories
        path = /var/share/public
        public = yes
[peixun]
        comment = All Printers
        path = /var/share/training
        public = no
        valid users = root,@tech
        writable = no
[kaifa]
        comment = All Printers132
        path = /var/share/devel
        public = no
        read only = no
        read list = @tech
        write list = root,@benet


七、启动Samba服务
    service smb start
    iptables -F
    setenforce 0
八、测试【在cmd下】
    \\192.168.5.*
    映射网络驱动器:
    \\192.168.5.*\peixun







你可能感兴趣的:(linux,samba)