Linux中架设Samba服务器 简介 操作

简介

Samba是用于Linux和Unix的标准Windows互操作性程序套件。意思是说,可以在window上对服务上的指定的目录增删改操作服务器上的文件。

操作

  1. 关闭防火墙

      service iptables stop
    
  2. 关闭 SELinux

      setenforce 0
    
  3. 安装 samba 和 samba-client

      yum install -y samba samba-client
    
  4. 添加用户

      useradd test
      pdbedit -a test
    
  5. 启动 samba 服务

    • 添加开机启动: chkconfig smb on
    • 立即启动 samba:service sam start
  6. 测试

    • 在window电脑中打开我的电脑
    • 在地址栏中输入 \IP
  7. 自定义共享目录

    • 创建共享目录,并修改权限
        madir -p /var/www/html
        chmod -R 777 /var/www/html
      
    • 修改配置文件:/etc/samba/smb.conf
      添加如下内容:
      [html]                       #共享目录名称
          path = /var/www/html     #共享目录位置
          browseable = yes         #是否可以浏览
          writeable = yes          #是否可以写入
          public = yes             #是否公开或者公共
      
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章