zoukankan      html  css  js  c++  java
  • Centos7 samba配置

    Samba配置了很多次,总是忘,现在写在博客里。

    免密码只读

    最主要的是免密配置,主要用到了两个配置,要写在[global]里:

            map to guest = Bad User
            guest ok = yes
    

    结果安装完了之后,文件夹被识别成了打印机,那是因为错配了一个参数。
    就是在配置public的时候复制时多了一个printable = Yes

        printable = Yes
    

    所有配置:

    # See smb.conf.example for a more detailed config file or
    # read the smb.conf manpage.
    # Run 'testparm' to verify the config is correct after
    # you modified it.
    
    [global]
            workgroup = SAMBA
            security = user
    
            passdb backend = tdbsam
    
            printing = cups
            printcap name = cups
            load printers = yes
            cups options = raw
            map to guest = Bad User
            guest ok = yes
    
    [homes]
            comment = Home Directories
            valid users = %S, %D%w%S
            browseable = No
            read only = No
            inherit acls = Yes
    
    [printers]
            comment = All Printers
            path = /var/tmp
            printable = Yes
            create mask = 0600
            browseable = No
    
    [print$]
            comment = Printer Drivers
            path = /var/lib/samba/drivers
            write list = @printadmin root
            force group = @printadmin
            create mask = 0664
            directory mask = 0775
    
    [public]
            comment = public
            path = /path/to/yourdir
            create mask = 0664
            directory mask = 0775
            public = yes
            writable = yes
            read only = no
    

    加密码可读写

    创建用户:

    useradd share -M -p 1234567
    pdbedit -a -u share
    

    配置:

    [root@localhost cc]# vim /etc/samba/smb.conf
    ……
    [asset]
            comment = public
            path = /home/asset
            create mask = 0777
            directory mask = 0777
            public = no
            writable = yes
            create mode = 0777
            valid users = share
            write list = share
            writable = yes
            force create mode = 0777
            directory mode = 0777
            force directory mode = 0777
            share modes = yes
    ……
    
  • 相关阅读:
    调整心态,夯实基础
    js实现轮播图动画(更新"旋转木马")
    封装简单动画函数-由简到完善
    纯Css绘制三角形箭头三种方法
    JS实现图片''推拉门''效果
    一个基于 canvas 的画板
    Python 控制台进度条的实现
    Flask博客开发——Tinymce编辑器
    Flask博客开发——登录验证码
    用于水和水蒸汽物性计算的Python模块——iapws
  • 原文地址:https://www.cnblogs.com/bugutian/p/12010209.html
Copyright © 2011-2022 走看看