zoukankan      html  css  js  c++  java
  • Linux搭建Samba服务,实现与window共享

    1.挂载光盘

    mkdir -p /media/cdrom

    mount -o loop /dev/cdrom /media/cdrom

    2.配置yum源

    vi /etc/yum.repos.d/local.repo

    配置内容如下:

    [redhat]

    name=redhat

    baseurl=file:///media/cdrom     (挂载光盘的位置)

    enabled=1

    gpgcheck=0

    保存,退出

    3.安装Samba服务

    yum clean all

    yum list          (查看yum是否配置正确)

    yum install -y samba

    4.备份配置文件,过滤#$^

    cp /etc/samba/smb.conf /etc/samba/smb.conf

    修改配置文件:

    [global]
    workgroup = MYGROUP     注:要与window系统在同一组内
    server string = Samba Server Version %v
    log file = /var/log/samba/log.%m
    max log size = 50
    security = user
    passdb backend = tdbsam
    load printers = yes
    cups options = raw
    [homes]
    comment = Home Directories
    browseable = no
    writable = yes
    [printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = no
    guest ok = no
    writable = no
    printable = yes
    [share]
    comment="666"
    path=/database
    public=no
    writable=yes

    5.创建共享目录,赋予权限

    mkdir /database

    chmod 777 /database

    6.创建Samba独立账户

    useradd samba

    pdbedit -a -u samba

    输入新密码

    7. 使用getsebool命令查询并过滤出所有与Samba协议相关的安全策略,打开samba_enable_home_dirs

    getsebool  -a  |grep  samba

    setsebool  -P  samba_enable_home_dirs=on

    semanage fcontext -a -t samba_share_t /database

     restorecon -Rv /database/ 

    8.重启Samba服务,设置开机自启动

    9..使用Window认证

    输入用户名:share

    密码:***

     

  • 相关阅读:
    Hadoop之HDFS的热备份
    Hadoop之联邦HDFS
    Hadoop之HDFS如何保证高可用
    Hadoop之HDFS的读流程
    Hadoop之HDFS数据写流程和写失败的情况
    Hadoop之HDFS的block、packet、chunk
    Hadoop之HDFS的元数据冷备份(CheckPoint)
    当ZooKeeper作为Dubbo的注册中心的时候,是怎么工作的?
    Dubbo
    mysql磁盘满了如何恢复
  • 原文地址:https://www.cnblogs.com/L1213/p/9628311.html
Copyright © 2011-2022 走看看