Samba... Configuration

Source: Internet
Author: User

Experimental steps:1. Install the RPM package for Samba (samba, Samba-common, samba-client)2. Create Samba users3. Modify the configuration file4. Restart Samba Services5. Set Directory access rights6. TestingThe steps are as follows: 1 . Install the RPM package ( By default , RHEL5 installs Samba related packages, can be viewed with the following command ) [[email protected] ~] #rpm-qa | grep sambaSamba-----All files for the Samba server programSamba-common-----Provides common files that both Samba servers and clients must usesamba-client-----Provides all the files for the Samba clientSamba-swat-----Provides management capabilities for Samba servers in the form of a web interface 2 . Create Samba users [[email protected] ~] #smbpasswd-A User1 ("-a" is to create a samba user, "-X" is deleted [[email protected] ~] #smbpasswd-a user2 In addition to samba users, "-D "is to disable samba with[[email protected] ~] #smbpasswd-a User3 account, "-e" is enabled for Samba user account) 3 . Modify the configuration file location of the Samba configuration file:/etc/samba/smb.conf[[email protected] ~] #vim/etc/samba/smb.conf Vi Open the configuration file, first introduce the Samba Server Security level: The system default setting " user " the Samba server has 5 security levels, user, share, server, domain, and ads, respectively. The Samba server also uses a password server and an encrypted password when different levels are set. 1, User-----Client Access server needs to enter a username and password, through authentication, to use the server's shared resources. This level transmits the password in an encrypted manner. 2, share-----Client Connection server does not need to enter the user name and password3. The server-----Client also needs to enter the user name and password when accessing, however, password Authentication requires the Password Authentication server to be responsible. 4, domain-----The user is authenticated with a local controller5, Ads-----If the Samba server is joined to the Windows Active Directory, the ads security level, the ads security level must also specify the password server Configuration of shared directories [Homes]-----Samba user's host directorycomment = Home directories-----Setting up shared description informationbrowseable = No-----directory browsing Permissionswritable = yes-----user can write to the shared directoryThis shared directory is available only to the user itself, and by default the user home directory is located in the/a directory, and each Linux user has a subdirectory named after the user name. The following are the settings for a shared printer:[Printers]-----shared printercomment = All Printers-----Set the shared description informationPath =/var/spool/samba-----Specify the paths to the shared directorybrowseable = No-----directory browsing PermissionsGuest OK = no-----allow guest accesswritable = No-----user can write to the shared directoryprintable = yes-----can printthe above is the system default settingsAdd a custom shared directory: (User1 has ownership of/asus, User2 has read-only access and cannot be accessed by other users; Public shared directory allows all users to access and upload files)[ASUS]comment = User1 directories-----Setting up shared description informationbrowseable = yes-----All Samba users can see the directorywritable = yes-----user can write to the shared directoryPath =/asus-----Specify the paths to the shared directory[public]comment = All user directories-----Set the shared description informationbrowseable = yes-----All Samba users can see the directorywritable = yes-----user can write to the shared directoryPath =/public-----Specify the paths to the shared directoryGuest OK = yes-----allow guest access 4. The samba service needs to be restarted after the configuration file has been modified [[email protected] ~] #service SMB RestartSamba server consists of two service programs2 SMBDThe SMBD Service program provides clients with access to shared resources in the server2 NMBDThe NMBD Service Program provides a resolution of the NetBIOS host name, which resolves the host name for a domain in a Windows network or a host in a workgroup 5 . Set directory Permissions [[email protected] ~] #mkdir/asus------Create a directory to share[[email protected] ~] #mkdir/public------Create a directory to share[[email protected] ~] #chmod 750/asus------Modify/asus permissions (owned by the ownerownership, group Read only, other users cannot access)[[email protected] ~] #chown user1/asus------To change/asus's owner to User1[[email protected] ~] #groupadd asus------add ASUS Group[[email protected] ~] #usermod –G asus user1------Add user1 to the ASUS Group[[email protected] ~] #usermod –G asus user2------Add user2 to the ASUS group[[email protected] ~] #chgrp asus/asus------To change the group of/asus toASUS[[email protected] ~] #chmod 777/public------Assign Full Control to all usersPermissionsafter the configuration is complete, also check the records in the/etc/service file that begin with "NetBIOS", the correct fileThe records are as follows, and if there are # or no such records before these records, they should be added manually, otherwise the user has noaccess to shared resources on Linux servers6. TestingFind an intranet Windows client, open My Network Places, enter the IP clicks of the Samba server"Search": you have already searched thedouble-click to open: Prompt for user name and password, first enter User1 username and passwordfor testing. Login successful,Open the host directory for User1, this directory user1 has all permissions, create a directory test oneunder,: You can createThe public directory allows any user to upload, download, and delete files,User1 has full control over the Asus directory, so user1 can do anything in this directoryswitch to another user test, since we are testing on the same computer, before testing, we must first understandthe cache on the computer: Open command prompt mode, "net Use/del *" is clearIn addition to the computer cachereopen My Network place, locate the shared resources of the Samba server and log in as User2as shown in the following pictures, User2 has read-only access to the Asus directory, and the public, User2Records have ownershipre-switch a user login, remember to clear the cache Oh, enter User3 username and password: User3 cannot access asus directoryUser3 only ownership of the USER3 and public directoriesThe verification process is verbose, huh! If there are errors above, please correct them, thank you!

This article is from the "Yang Shejun" blog, make sure to keep this source http://yangxuejun.blog.51cto.com/623927/180224

Samba... Configuration

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.