1. check whether the required software rpm & amp; ndash; qa | grepsamba2 for samba is installed. run the following command rpm & amp; ndash; ivhsamba * to install the rpm Package for samba *. rpm (common tool and library package for main package client package, graphical management toolkit) or you like...
1. check whether samba software is installed.
Rpm-qa | grep samba
2. install the samba rpm Package and use the following command.
Rpm-ivh samba *. rpm
(Master package client package common tools and library package, graphical management toolkit)
Or if you have configured YUM, you can directly use the following command to operate
Yum install samba (this method is the best, you can install all the packages about samba completely)
3. build a process
[1] edit the main configuration file/etc/samba/smb. conf, specify the shared directory, and set the sharing permission for the shared directory;
[2] specify the log file name and storage path in the main configuration file smb. conf;
[3] set local system permissions for the shared directory;
[4] reload the configuration file or restart the smb service to make the configuration take effect.
4. samba server security mode
[1] share security level mode
When a customer logs on to the server, the user can browse server resources without entering the user name and password. It is applicable to public shared resources with poor security.
[2] user security mode
When a customer logs on to the server, the account and password must be submitted for access after verification. this is the default level.
[3] server security mode
The customer needs the account password and submits it to a server for verification. If an error occurs, the user-level access will be used.
[4] domain security level mode,
If a server is added to a domain, domain control is required for verification. a domain-level server is only a member client of the domain and does not have the characteristics of the server.
5. share server instance
1) modify the main configuration file/etc/samba/smb. conf.
Vim/etc/samba/smb. conf
[1] set the samba Server workgroup name to workgroup.
[2] add the samba server comment to file server
[3] set samba security level to share mode, allowing anonymous access
Workgroup = workgroup
Server string = file server
.........
Security = share
.........
[4] set the shared directory name to public.
[5] set the absolute path of the shared directory to/share
[6] set to allow anonymous access
[Public]
Comment = public
Path =/share
Public = yes
Save the settings and exit.
6. reload the configuration
Service smb restart
Or service smb reload
After the configuration is complete, you can test the effect.
20111026 update
7. user server instance
[1] add the system users you need
Useradd test
Passwd test
[2] add the system user to the/etc/samba/smbpasswd file
Smbpasswd-a test
[3] modify the main configuration file smb. conf of the samba Server
Set user security level
Security = user
Set the file path for user authentication
Smb passwd file =/etc/samba/smbpasswd
Configure the access path
[Test]
Comment = test data # Share Name: test data
Path =/share/test01
Valid users = @ test
[4] reload the configuration file or restart the service
Service smb reload or service smb restart
[5] how to test the results?
Note that the firewall and SElinux must be disabled for the above configurations. otherwise, problems may occur.
This article is from the "Steven Home" blog