Deployment of Samba enterprise-level file servers in RHEL6.5

Source: Internet
Author: User
Tags server installation and configuration
1. lab requirements: 1) Use the RPM package to install the samba service. 2) Implement anonymous access and verify that files and directories can be read and written. 3) implement access for specified users. 4) implement access for specified users, and assign different permissions to the user. 5) Implement the user

1.Lab requirements:

1) Use the RPM package to install the samba Service

2) Implement anonymous access to verify that files and directories can be read and written.

3) implement access from a specified user

4) implement access by the specified user and grant different permissions to the user

5) access the user's alias and test the permission

6) restrict specific access addresses

7) access Shared Resources in windows

 

2.Lab environment:

Linux Server: Red Hat Enterprise Linux 6.5 IP: 192.168.10.3

Windows Client: Windows 7 Ultimate x64 IP: 192.168.10.2

Samba Software Version: samba-3.6.9

3.Tutorial steps:

Basic installation operations

 

A.Mount the system disk and install samba

To install the samba service, you need to install the rpm package. The rpm installation package is generally stored in the Packages directory on the system disk. First, run the mount command to check whether the disk is mounted to the system.

If no disk is attached, manually mount the disc to the mnt directory of the system.

Check whether the disc has been attached.

Find the samba service package in the Packages directory and install

 

B.View samba configuration files

After samba is installed, we need to modify the configuration file if we want the server to work as required.

You can use rpm-qc to view the installation location of a document with installed software.

The conf configuration file is not displayed, but according to experience, the conf configuration file will be placed in the/etc directory, find the/etc/samba/directory, and find the main configuration file smb. conf

[Root @ localhost ~] # More/etc/samba/smb. conf view the content in the file. It is found that the content is very long and there are many # comments.

For convenience, we can filter out all rows with # numbers and save the filtered file content as another file smb. con:

[Root @ localhost ~] # Grep-v "#"/etc/samba/smb. conf>/etc/samba/smb. con

 

Check that smb is already available. con file, it is recommended that the original. do not delete the configuration file at the end of conf. You can create a backup for it by name to prevent future configuration errors.

 

[Root @ localhost ~] # Cd/etc/samba # Switch to the samba directory

[Root @ localhost samba] # mv smb. confsmb. conf. back # back up the conf file

[Root @ localhost samba] # mv smb. consmb. conf # rename smb. con to smb. conf

 

Implement anonymous access to verify that files and directories can be read and written.

 

[Root @ localhostsamba] # vi smb. conf # Open the master configuration file

 

[Global]

 

Workgroup = MYGROUP

Server string = Samba Server Version % v

 

; Netbios name = MYSERVER

 

; Interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24

; Hosts allow = 127. 192.168.12. 192.168.13.

 

 

Log file =/var/log/samba/log. % m

Max log size = 50

 

 

Security = share

Passdb backend = tdbsam

 

The above is the configuration content in the [global] global mode, and others can be kept by default. We are concerned that if anonymous access is to be implemented, you only need to modify the security level to share (the default is user)

 

Configure the share directory and insert the following lines at the end of the configuration file:

[Share] # specify the share Name of the Directory

 

Path =/opt/share # specify the share directory

 

Public = yes # public = guest OK, set to yes to allow anonymous users to access

 

Browseable = yes # allows anonymous users to view shared content

 

Writable = yes # Set the write permission.

 

Createmask = 0644 # Set the permission for creating a new file. This indicates that the owner has the read and write permissions. Other users only have the read-only permission (rw-r --)

 

Directory mask = 0755 # Set the permission for creating a directory. This indicates that the owner has the read and write permissions, and others do not have the write permission (rwxr-xr-x)

 

A.The modified script:

 

[Root @ localhostsamba] # mkdir/opt/share # create a share directory

[Root @ localhostsamba] # chmod 777/opt/share # change the permission to 777

 

[Root @ localhostsamba] # service smb start # start the samba service

 

[Root @ localhostsamba] # netstat-ant # view the network port status

Ports of samba 139 and 445 are being monitored. The samba service is normal. You can test the ports on the client. Firewall and selinux must be disabled before testing.

 

[Root @ localhost samba] # service iptables stop

Iptables: Set the chain to policy ACCEPT: filter [OK]

Iptables: clear firewall rules: [OK]

Iptables: uninstalling module: [OK]

 

[Root @ localhost samba] # setenforce 0

 

------------------------------------ Split line ------------------------------------

How to Use Samba shared file http://www.linuxidc.com/Linux/2014-07/104894.htm in Ubuntu 14.04

VMWare Virtual Machine Ubuntu dual Nic samba access speed doubled http://www.linuxidc.com/Linux/2013-06/85445.htm

Samba File Sharing Server joining Windows Server 2003 domain http://www.linuxidc.com/Linux/2013-06/86391.htm

Samba installation configuration http://www.linuxidc.com/Linux/2013-06/86101.htm

Configuration http://www.linuxidc.com/Linux/2013-01/78390.htm for Samba services in CentOS 6.2

Samba Server installation and configuration http://www.linuxidc.com/Linux/2014-12/110459.htm

Graphic http://www.linuxidc.com/Linux/2013-01/78234.htm for building Win7 + VMware + Fedora18 Samba Server

------------------------------------ Split line ------------------------------------

For more details, refer to the highlights on the next page.: Http://www.linuxidc.com/Linux/2015-07/119842p2.htm

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.