zoukankan      html  css  js  c++  java
  • centos 7安装samba 设置文件共享

    1、检查是否已经安装

    rpm -qa |grep samba
    

    2、安装

    yum -y install samba
    

    3、配置samba

    修改之前先备份下 cp /etc/samba/smb.conf /etc/samba/smb.back.conf

    vim /etc/samba/smb.conf
    

    配置文件的内容如下,其他的可以直接删除([axure]代表的是共享文件名):
    注意:不要使用security = share 也不要使用,也不要配置guest,window 10安全策略不允许,需要配置账户

    [global]
            workgroup = SAMBA
            log file = /var/log/samba/log.%m
            max log size = 50
            passdb backend = tdbsam
            printing = cups
            printcap name = cups
            load printers = no
            cups options = raw
            security = user
            #map to guest = bad user
    [axure] 
            comment= Axure share
            path = /data/axure
            public = no
            writable = yes
            available = yes
            browsable = yes
            create mask = 0777
            directory mask = 0777
    

    保存后用testparm验证配置文件是否正确

    4、配置用户

    1. 添加系统用户(用户名为axure ,如果文件用户文件存在的话也没关系)
      useradd -d /data/axure -s /sbin/nologin axure
    2. 把用户添加到samba用户,填2次密码确定
      pdbedit -a -u axure

    5、创建文件和设置权限

    mkdir /data/axure
    chmod 777 /data/axure
    

    6、配置samba开机启动和重启等

    systemctl enable smb
    systemctl start smb
    systemctl status smb
    systemctl restart smb
    

    7、访问共享文件

    1. window:win+r直接\\ip 填账号密码就行了
    2. mac:访达->前往->连接服务器 smb://ip
  • 相关阅读:
    模拟105 题解
    模拟104 题解
    模拟103 题解
    模拟102 题解
    python与 Ajax跨域请求
    Django--进阶--中间件的使用
    Django--权限组件
    python 最基本的的单例模型的实现及应用
    Django-数据库访问优化
    Create views of OpenCASCADE objects in the Debugger
  • 原文地址:https://www.cnblogs.com/nickchou/p/15668738.html
Copyright © 2011-2022 走看看