CentOS Samba Build

Source: Internet
Author: User

1. Requirements:

Establish two users (zx,zxadmin), zxadmin can access all directories, ZX can only access the specified directory.

2. Install SMB

[email protected]/]# Yum install samba-y

3. Create user (Zxamin primary account, ZX as General account, ZX belongs to Zxadmin Group), and convert account to SMB user

[Email protected]//]# useradd-g zxadmin ZX
[Email protected]/]# smbpasswd-new/]# smbpasswd-new  SMB password: Added user ZX.

4. Create the SMB directory (the SMB directory belongs to the Zxadmin user, and set the SMB directory permission to 770)

[[email protected]/]# mkdir/data[[email protected] data]# mkdir/data/smb1[[email protected] data]# MKDIR/DATA/SMB2 
[Email protected]/]# chown-r  zxadmin.zxadmin/data/
770 /data/

5. Configuring smb.conf (vim/etc/samba/smb.conf)

[SMB1]         = smb1        =/data/smb1        = Yes        = zxadmin  #指定zxadmin账户, This directory can only be accessed        zxadmin = no        = YES[SMB2]        = smb2        =/data/ SMB2         = Yes        = zxadmin,zx   #指定zx和zxadmin账户, this directory is public directory         = no         = yes

6. Start the SMB Service

[[email protected] samba]#/etc/init.d/SMB startstarting SMB services:                                     [  OK  ]

7. Turn off the firewall and SELinux

8. Access Testing

CentOS Samba Build

Related Article

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.