Linux Shared Folders Samba

Source: Internet
Author: User

First, the service side

1. Install the Samba package

Yum-y Install Samba

2. Add Samba Account

Useradd-s/sbin/nologin Harry

Pdbedit-a Harry//Enter Password 2 times

3. Modify the Configuration

Vim/etc/samba/smb.conf

Add in last line

[Common]

Path =/common


Second, the client

    1. Installing the Client software: smb-client

    2. To view the server-side shared folders: smbclient-l//172.25.0.11 password is not entered, press ENTER directly

    3. Command line view: Smbclient-u Harry//172.25.0.11/common

      Note that this is where selinux blocks viewing and read-write permissions and needs to be set

      [Email protected] ~]# Getsebool-a | grep Samba

      Samba_export_all_ro-On

      SAMBA_EXPORT_ALL_RW-On

General use Mount view: Required Packages: Cifs-utils

_netdev: Mount the device after you open the Network service

To modify a configuration file:

Vim/etc/fstab

172.25.0.11/common/mnt/samba CIFS User=zsq,pass=123,_netdev 0 0

Verify:

Mount-a

Df-h

If you want to set up read-write, add the samba.conf after the server

Write list = zsq

Then set ZSQ Local read-write permission, we recommend using Setfacl

####################################

Multiuser Multi-user access

The client modifies the configuration file:

172.25.0.11/common/mnt/samba CIFS USER=ZSQ,PASS=123,_NETDEV,MULTIUSER,SEC=NTLMSSP 0 0

Re-mount

Umount/mnt/samba

Mount-a

Verify:

Su-student

Cd/mnt/samba

Cifscreds add-u zsq 172.25.0.11 Enter password

Touch C.txt



Linux Shared Folders Samba

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.