美文网首页
samba安装/配置/挂载

samba安装/配置/挂载

作者: PonyTang3 | 来源:发表于2019-02-25 15:53 被阅读0次

    服务端安装

    yum install samba samba-client samba-common -y
    

    配置

    vim /etc/samba/smb.conf

    [global]
            workgroup = WORKGROUP
            security = user
    
            passdb backend = tdbsam
    
            printing = cups
            printcap name = cups
            load printers = yes
            cups options = raw
            netbios name = centos
    
            # 自定义端口
            smb ports = 13501 13502
    
    [p2presources]
            comment = p2presources
            path = /www/wwwroot/p2presources
            valid users = @www
            admin users = @www
            browseable = yes
            public = yes
            write list = @www
            create mask = 0777
            directory mask = 0777
    

    用户添加

    useradd www
    groupadd www
    usermod -a -G www www
    smbpasswd -a www
    

    文件夹权限设定

    chown -R www:www /p2presources
    chmod -R 0775 /p2presources
    

    开启服务

    systemctl enable smb.service
    systemctl enable nmb.service
    systemctl start smb.service
    systemctl start nmb.service
    

    客户端安装

    yum -y install cifs-utils
    

    挂载

    1. 手动挂载
    sudo mount -t cifs -o port="13501",username="www",password="www" //192.168.20.2/p2presources /p2presources/ 
    
    1. 自动挂载
      vim /etc/fstab
    //192.169.20.2/p2presources   /p2presources   cifs    uid=1006,username=www,password=www,port=13501 0 0
    

    需要防火墙开放相关端口

    相关文章

      网友评论

          本文标题:samba安装/配置/挂载

          本文链接:https://www.haomeiwen.com/subject/gkjgyqtx.html