samba服务器配置

00 目的
    在win7系统下通过samba服务实现win7和redhat系统文件共享
01 环境
    虚拟机、win7、redhat
02 步骤
    1、安装rpm包(缺省情况下redhat安装了samba的相关软件)
        通过以下命令查看
        #rpm -qa | grep samba
            samba -----samba服务器程序的所有文件
            samba-common -----提供了Samba服务器和客户机中都必须使用的公共文件
            samba-client -----提供了Samba客户机的所有文件
    2、创建samba用户
        useradd user1 -p 123456
        #smbpasswd -a user1
    3、修改配置文件
        #vim /etc/samba/smb.conf
       
        添加如下信息
            [ASUS]
            comment = user1 Directories -----设置共享的说明信息
            browseable = yes -----所有samba用户都可以看到该目录
            writable = yes -----用户对共享目录可写
            path = /ASUS -----指定共享目录的路径
            [public]
            comment = all user Directories -----设置共享的说明信息
            browseable = yes -----所有samba用户都可以看到该目录
            writable = yes -----用户对共享目录可写
            path = /public -----指定共享目录的路径
            guest ok = yes -----允许来宾访问
    4、修改完配置文件后需要重启samba服务
        #service smb restart
       
    5、设置目录权限
        #mkdir    /ASUS
        #mkdir     /public
        chmod    750 /ASUS
        chown user1 /ASUS
        chmod 777 /public
    6、打开Win7下的网络,在地址栏中输入redhat地址。例如:\\192.168.247.136
        弹出对话框,输入user1 密码
        如果这个时候看到网络上的文件夹,双击打开,如果没有权限,查看是否打开redhat下的selinux
        如果打开了,请关闭---OK
       
03 参考文档
    1、http://yangxuejun.blog.51cto.com/623927/180224
    2、http://www.2cto.com/os/201112/113343.html
    3、http://bbs.51cto.com/topic/thread-922599.html
    4、http://roclinux.cn/?p=2264

原文地址:https://www.cnblogs.com/matrix77/p/2753629.html