Linux uses Samba for file sharing

Source: Internet
Author: User

The early network wants to share files between different hosts to use the FTP protocol to transfer, but the FTP protocol can only be transferred files but not directly modify the other host data, so it is not very convenient, so there is an NFS open source file sharing program, NFS is a service that can attach multiple Linux remote host data to a local directory, is a lightweight file sharing service, and does not support file sharing between Linux and Windows systems.

The Samba service program is an open source file sharing software that is based on the SMB protocol and consists of a server and a client, enabling file sharing between Linux and Windows systems.

1. SMB implements Linux with Windows file sharing

(1) Check whether the current user authentication mode

Security == Tdbsam

(2) Create a shared folder

Mkdir/home/fate/sharedir

(3) Adding shared folder information

Cd/etc/samba/smb.conf

[Fate0729]comment= Do notarbitrarily modify the database filepath=/home/fate/sharedir  public =nowritable=yes[sharedir]comment= does notarbitrarily modify the database filepath =/home/fate/sharedirpublic =nowritable=yes

(4) Restart the SMB service after saving the smb.conf file

Systemctl Restart SMB

(5) Add boot entry

Systemctl Enable SMB

(6) Clear the firewall rule chain

Iptables-fservice iptables Save

(7) Create an SMB service standalone account

Pdbedit-a-U Fate

(8) Running the SELinux rule

// set the owner and all groups of the shared directory to fate user chown-rf fate:fate/home/fate/sharedir//  Boolean value that allows SELinux to share home directories for SMB users setsebool-P samba_enable_home_dirson//  Set the SELinux security context for the shared directory properly semanage fcontext-a-t samba_share_t/home/fate/sharedir//  Make the new security context effective immediately Restorecon-rv/home/fate/sharedir
2. Testing

(1) Enter the Linux host IP \\192.168.3.10 at the command line

(2) Login account password

Linux uses Samba for file sharing

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.