zoukankan      html  css  js  c++  java
  • samba 使用

    在系统开发过程中,因为做了负载均衡,文件无法保存在程序的单节点中,需要使用使用独立的文件服务进行管理,调研了几个软件,samba比较适合我们的需求。

    一、安装

    全安装

    sudo dnf install samba samba-common samba-client
    

    客户端安装

    yum install -y samba-client
    

    查看版本号

    smbd -V
    

    编辑配置文件

    vim /etc/samba/smb.conf
    
    [global]
    workgroup = WORKGROUP
    server string = Samba Server %v
    netbios name = centos-8
    security = user
    map to guest = bad user
    dns proxy = no
    
    [public]
    path = /share
    browsable =yes
    writable = yes
    guest ok = yes
    read only = no
    
    

    运行测试命令

    testparm
    

    启动samba

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

    二、客户端连接

    从客户端连接到 samba

    smbclient //192.168.0.120/public -U root
    ls //查看文件
    get xxx.xxx //下载文件
    put xxx.xxx //上传文件
    

    挂载目录,在指定服务器上执行

    mount -t cifs //192.168.0.120/public /share -o username=root,password=xxxxxx
    
    umount /share
    
    
  • 相关阅读:
    python-杂烩
    24 Python 对象进阶
    23 Python 面向对象
    22 Python 模块与包
    21 Python 异常处理
    20 Python 常用模块
    18 Python 模块引入
    2 Python 基本语法
    1 Python 环境搭建
    3 Python os 文件和目录
  • 原文地址:https://www.cnblogs.com/littlewrong/p/14816459.html
Copyright © 2011-2022 走看看