The Samba server is configured in Linux to enable file sharing on the LAN.

Source: Internet
Author: User

linux中搭建samba服务,实现局域网中文件共享

Samba is a free software that implements the SMB protocol on Linux and UNIX systems, consisting of servers and client programs. SMB (Server Messages block, information service blocks) is a kind of communication protocol for sharing files and printers on LAN, which provides shared services of files and printers among different computers in LAN.

 实验环境:Linux6、虚拟windows7/10、yum仓库、同一网段。`rpm -q samba`              //查看Samba安装与否 `yum install /mnt/Packages/samba-3.6.9-164.el6.x86_64.rpm`         //需要安装的samba包 `rpm -qc samba `              //看samba配置路径    `cd /etc/samba`             //进入配置路径查看信息

`mv smb.conf  smb.conf.bk‘ `       // 重命名配置文件`grep -v "#" smb.conf.bk >smb.conf`   //反向过滤掉带#的注释内容`vim smb.conf`    //进入配置文件中进行编辑末行模式 set nu 查看行数命令模式/security  找到后将user改成share命令模式G到行尾命令模式o下一行插入`[share]`                  //文件名`path=/opt/share`         //定义路径`public=yes   `               //共享`browseable=yes `       // 可访问的权限`writable=yes`              //可写入的权限`create mask=0644`     // 创建文件自身权限`directory mask=0755`  //创建文件夹自身权限`setenforce 0 `                     //关闭安全组件`service iptables stop`          //关闭防火墙`service smb start`                //开启服务cd /optmkdir sharecd share/echo "this is share" >share.txtls可以看到有一个share.txt文件下面进入虚拟windows进行验证


Thank you for reading ~

The Samba server is configured in Linux to enable file sharing on the LAN.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.