Linux and cloud Computing--phase tenth: Samba Server Setup-SMB shared directory and multiuser SMB mounts

Source: Internet
Author: User

Linux and Cloud computing--the second phase of Linux Server Setup The Tenth chapter:Samba server Set up-SMB shared directory and multiuser SMB mount share directory through SMB

in the Server Configure the SMB service on

Your SMB server must be a member of the staff workgroup

Shared/common directory share name must be common

Only clients within the example.com domain can access the common share

Common must be browsable.

The user Andy must be able to read the contents of the share, and if necessary, verify that the password is Redhat

[1] Installation Configuration Samba.

[[email protected] ~] #yum Install samba-y

[[email protected] ~] #firewall-cmd--add-service=samba

[[email protected] ~] #firewall-cmd--add-service=samba--permanent

[[email protected] ~] #firewall-cmd--add-service=mountd

[[email protected] ~] #firewall-cmd--add-service=mountd--permanent

[[email protected] ~] #cd/etc/samba/

[[email protected] ~] #vim smb.conf

Workgroup = Staff

[[email protected] ~] #mkdir/common

[[email protected] ~] #chcon-R-T samba_share_t/common/

[[email protected] ~] #vim smb.conf

[Common]

Path =/common

Hosts allow = 192.168.96.

browseable = yes

[[email protected] ~] #yum Install samba-client-y

[[email protected] ~] #smbpasswd -a Andy

[[email protected] ~] #systemctl start SMB

[[email protected] ~] #systemctl Enable SMB

[2] in the on the client

[[email protected] ~] #yum Install samba-client cifs-*-y

[[email protected] ~] #smbclient-L/system1/-u Andy

[[email protected] ~] #smbclient//system1/common-u Andy

Configuring Multi-user SMB mounts

in the Server share via SMB directory/ MIS The following requirements are met:

Share named Mis

Shared directory MIS can only be used by clients in the example.com domain

Shared directory MIS must be able to be browsed

The user Silene must be able to access the share in a read manner, and the access password is Redhat

User Akira must be able to read and write access to this share, the access password is Redhat

this share is permanently mounted on the Client the/mnt/multi directory on the. example.com. and use user Silene as authentication any user can temporarily get write permission through user Akira

[1] Server -side Configuration

[[email protected] ~] #mkdir/mis

[[email protected] ~] #vim smb.conf

[MIS]

Path =/mis

Hosts allow = 192.168.96.

browseable = yes

writable = no

Write list = Akira

[[email protected] ~] #chmod O+w/mis

[[email protected] ~] #smbpasswd -a Silene

[[email protected] ~] #smbpasswd -a Akira

[[email protected] ~] #chcon-R-T Samba_share_t/mis

[[email protected] ~] #systemctl Restart SMB

[2] Client Configuration

[[email protected] ~] #mkdir/mnt/multi

[[email protected] ~] #smbclient-L/server.example.com/-u silene

[[email protected] ~] #vim/etc/fstab

//server.example.com/mis /mnt/multi CIFS DEFAULTS,MULTIUSER,USERNAME=SILENE,PASSWORD=REDHAT,SEC=NTLMSSP 0 0

[[email protected] ~] #mount -A

You can try to switch to another user

[[email protected] ~] #cifscreds Add system1-u Akira

Then try to write to the/mnt/multi directory


This article is from the "11830455" blog, please be sure to keep this source http://11840455.blog.51cto.com/11830455/1836524

Linux and cloud Computing--phase tenth: Samba Server Setup-SMB shared directory and multiuser SMB mounts

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.