zoukankan      html  css  js  c++  java
  • samba

    服务端:

    [root@linuxprobe ~]# yum install samba -y
    [root@linuxprobe ~]# mv /etc/samba/smb.conf /etc/samba/smb.bak
    [root@linuxprobe ~]# cat /etc/samba/smb.bak | grep -v "#" | grep -v ";" | grep -v "^$" > /etc/samba/smb.conf
    [root@linuxprobe ~]# vim /etc/samba/smb.conf
    [global]
            workgroup = MYGROUP
            server string = Samba Server Version %v
            log file = /var/log/samba/log.%m
            max log size = 50
            security = user
            passdb backend = tdbsam
    [rick]
            comment = ding
            path = /rick
            public = no
            writable = yes
     
    [root@linuxprobe ~]# systemctl restart smb
    [root@linuxprobe ~]# systemctl enable smb
    ln -s '/usr/lib/systemd/system/smb.service' '/etc/systemd/system/multi-user.target.wants/smb.service'
    
    [root@linuxprobe ~]# id linuxprobe
    uid=1000(linuxprobe) gid=1000(linuxprobe) groups=1000(linuxprobe)
    [root@linuxprobe ~]# pdbedit -a -u linuxprobe
    new password:
    retype new password:
    Unix username:        linuxprobe
    
    [root@linuxprobe ~]# mkdir -p /rick
    [root@linuxprobe ~]# chown -Rf linuxprobe:linuxprobe /rick
    [root@linuxprobe ~]# chmod -Rf 777 /rick
    
    [root@linuxprobe
    ~]# getsebool -a | grep samba samba_create_home_dirs --> off samba_domain_controller --> off samba_enable_home_dirs --> off samba_export_all_ro --> off samba_export_all_rw --> off samba_portmapper --> off samba_run_unconfined --> off samba_share_fusefs --> off samba_share_nfs --> off sanlock_use_samba --> off use_samba_home_dirs --> off virt_sandbox_use_samba --> off virt_use_samba --> off [root@linuxprobe ~]# setsebool -P samba_export_all_rw=on
    [root@linuxprobe
    ~]# iptables -F [root@linuxprobe ~]# service iptables save iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]

    客户端:

    [root@localhost ~]# yum install cifs-utils -y
    [root@localhost ~]# vim auth.smb
    username=linuxprobe
    password=ding
    domain=MYGROUP
    
    [root@localhost ~]# mkdir /rick
    [root@localhost ~]# vim /etc/fstab
    //192.168.10.10/rick /rick cifs credentials=/root/auth.smb 0 0
    [root@localhost ~]# mount -a
    [root@localhost ~]# df -h
    //192.168.10.10/rick    18G  3.0G   15G  17% /rick
  • 相关阅读:
    【JAVA基础】private 的使用
    【nginx】配置文件(模块、反向代理、负载均衡、动静分离)
    【Nginx】命令行安装
    【UNIAPP】websocte实现,功能:指定房间聊天,匿名进入 功能,文字与图片
    【前端JS】input对象图片在线转base64
    【UNIAPP】上传视频,进度条的前台与后端
    【IO阻塞异步】协程使用异步,异步爬虫,异步数据库操作
    【装饰器】原理以及基础使用
    可编程网络DataPath 及XDP
    gitlab 代码协作流程
  • 原文地址:https://www.cnblogs.com/dinghailong128/p/12178414.html
Copyright © 2011-2022 走看看