Configure the Samba service for the RHCE Simulated Test

Source: Internet
Author: User
Configure the Samba service for the RHCE simulated test and share the/home/movie file directory. Only 192.168.0.0/24, 192.168.1.0/24, and 127.0.0.1 can be accessed. The shared file name is [Movie File]. the user cannot view it. Only the student group has the write permission. At the same time, you must share the home directories of every user in the student group, and set Netbiosname = GUEST200X # rpm-iv

Configure the Samba service for the RHCE simulated test and share the/home/movie file directory. Only 192.168.0.0/24, 192.168.1.0/24, and 127.0.0.1 can be accessed. The shared file name is [Movie File]. you cannot see that only the student group has the write permission. At the same time, you must share the home directories of every user in the student group and set Netbios name = GUEST200X.

# Rpm-ivh samba-3.0.25b-0.el5.4.i386.rpm or you can use # yum install samba-3.025b

# Service smb restart // start the samba service

# Chkconfig smb on // set to automatically start the samba Service

# Mkdir/home/Upload File

# Chown root: student/home/folder File

# Chmod 3777/home/share // change the usage permission of the Upload File and grant the sgid and sticky Permissions

# Smbpasswd-a student1 // Add PASSWD to student1

# Vim/etc/samba/smb. conf // enter the configuration file

(Modify the following three items in the goble part)

Workgroup = WORKGROUP // if you do not have any special requirements, we recommend that you change it to the default group name WORKGROUP in WINDOWS.

Netbios name = GUEST200X

Hosts allow = 127. 192.168.0. 192.168.1.

(=== Share definition section ====)

[Home] // The home directory is generally shared by default.

Comment = Home Directories

Browseable = no // cannot be viewed

Writable = no // write is not allowed (can be set as needed)

[Upload File]

Comment = yangbang

Path =/home/folder file // path of the shared folder

Public = no // you cannot log on anonymously.

Browseable = no

Writable = no

Write list = @ student // indicates that all users in this group meet

Valid users = @ student

#/Etc/init. d/smb restart // restart the service

# Smbclient-L 192.168.0.X-N // test the sharing condition (browseable = yes)

# Getsebool-a | grep samba // view the BOOLEAN value in samba

# Setsebool-P samba_enable_home_dirs on // modify the selinux permission for logging on to the Home Directory

(After the BOOLEAN value of SELINUX is modified, you still cannot log on, And The selinux attribute of the file directory is also required)

# Chcon-t samba_share_t/home/* // Change The selinux security context attributes of the file directory. You can use # ll-Z/home to view the security context attributes.

# Chcon-t samba_share_t/home // Change The selinux security context attribute of the file directory

# Chcon-t samba_share_t/home/share/* // Change The selinux security context attribute of the file directory

# Smbclient // 192.168.1.107/student1-U student1 or # smbclient // 192.168.1.107/fill file-U student1 % password // for testing

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.