zoukankan      html  css  js  c++  java
  • centOS 7 部署samba

    部署samba

    **每个用户有自己的目录,可以浏览内容,也可以删除**

    清空防火墙规则

    [root@bogon ~]# iptables -F

    安装samba

    [root@bogon ~]# yum -y install samba

    配置文件在/etc/samba/smb.conf

    添加用户

    [root@bogon samba]# useradd smbtest
    [root@bogon samba]# usermod -s /sbin/nologin smbtest
    [root@bogon samba]# smbpasswd -a smbtest
    New SMB password:
    Retype new SMB password:
    Added user smbtest.

    重启服务测试连接

    [root@bogon samba]# systemctl restart smb

    smb删除用户用以下命令:

    smbpasswd -x smbtest

    **所有的用户共享一个目录,只能浏览内容,不能删**

    新建share目录,修改权限

    [root@bogon samba]# mkdir /share
    [root@bogon samba]# ll /share -d
    drwxr-xr-x 2 root root 6 6月 1 00:53 /share
    [root@bogon samba]# chmod o+w /share
    [root@bogon samba]# ll -d /share
    drwxr-xrwx 2 root root 6 6月 1 00:53 /share

    修改配置,重启服务

    [root@bogon samba]# vim smb.conf
    [public]
    comment = Public Stuff
    path = /share
    public = yes
    writable = no
    printable = no
    write list = lucaq,lucaqsmb,smbtest
    
    [root@bogon samba]# systemctl restart smb

    windows下测试:

    net use
    net use * /del
    \192.168.16.99public
  • 相关阅读:
    IO多路复用
    事件驱动模型
    协程
    进程
    py2与py3的编码问题
    Linux Centos7 网卡无法启动
    监控的法则
    如何优雅的采集activeMQ性能指标
    一分钟性能分析
    beta版 tomcat 应用监控指标
  • 原文地址:https://www.cnblogs.com/lucaq/p/6925480.html
Copyright © 2011-2022 走看看