1. what is sambasamba? it is a tool suite that implements the SMB (ServerMessageBlock) protocol or NETBIOS/LanManager protocol on Unix. The SMB protocol is usually used by the windows series for disk and printer sharing. Simply put, samba can build a shared server, and windows users can share linux files. 2. install and configure samba1 and install yuminstallsambasyste
I. What is samba?
Samba is a tool suite that implements the SMB (Server Message Block) protocol on Unix, or the NETBIOS/LanManager protocol. The SMB protocol is usually used by the windows series for disk and printer sharing.
Simply put, samba can build a shared server, and windows users can share linux files.
2. install and configure samba
1. install
Yum install samba system-config-samba-client samba-common
If you cannot find the package, change the epel source and search for it in my blog.
2. configuration
[Root @ samba etc] # mv/etc/samba/smb. conf/etc/samba/smb. conf_bak // backup [root @ samba etc] # vim/etc/samba/smb. conf // add the following content [global] workgroup = SMBGROUPnetbios name = sambaserver string = Samba Serverclient code page = 950log file =/var/log/samba/% m. logmax disk size = 1000max open file = 100 security = encryption encrypt passwords = yessmb passwd file =/etc/samba/smbpasswd [homes] comment = Private Directoriesbrowseable = nowritable = yesvalid users = % Screate mode = 0755 directory mode = 0755 [public] comment = Publicpath =/var/www/publiccreate mode = 0777 directory mode = 0777 public = yeswritable = yes
Parameter description:
[Global] parameter description
1. workgroup this is the name of the working group to which the server is to be added.
2. replace the netbios name host name with the IP address. for example, \ 192.168.1.108 \ public can be replaced with \ smb-server \ public
3. server string. this is the description of setting the server host.
4. the client code page sets the character encoding table used by the client to access the Samba Server. 950 supports Chinese characters
5. the log file option requires the Samba server to use a separate log file for each connected machine.
6. max log size specifies the maximum size (in KB) of the log file. if it is set to 0, there is no limit. The default value is 5000.
7. max disk size: set the maximum disk space that can be shared. the unit is MB. the default value is 0, indicating that no limit is imposed.
8. max open file sets the maximum number of files that can be opened on the same client. the default value is 10000.
9. security sets the Samba server security level. By default, the user level is used.
# Samba servers have four security levels.
Share: you can log on to the Samba server without your account or password.
User: This level is used. The Samba server that provides the service checks the user account and password.
Server: when this level is used, you can specify another Samba server to check the account and password.
Domain: to use this level, you must specify a Windows NT/2000/XP server (usually a domain controller) to verify the account and password entered by the user.
10. does encrypt passwords adopt password encryption?
11. smb passwd file is used to store the encrypted password file on the Samba server.
[Public], [homes] shared directory parameter description
1. comment's description and comments on shared resources
2. browseable: set whether the user can see the shared resource. the default value is yes.
3. writable: set whether shared resources can be written.
4. create mode sets the file access permission. the default value is 0744.
5. set the directory access permission in directory mode. the default value is 0755.
6. If path is a shared resource, specify the location of the Directory. If path is a printer, specify the location of the printer queue.
7. read only sets whether shared resources are read-only or writable. the default value is yes.
8. does Public allow users to access this resource without using their accounts and passwords?
9. set whether to enable the shared resource. The default value is yes. If this parameter is set to no, no matter the other parameter 10 or the number is set, no one can use this resource.
11. users with access to valid users are limited to users. % S is automatically converted to a logon account.
3. set the shared directory
[root@samba etc]# mkdir -p /var/www/public[root@samba etc]# chmod -R 777 /var/www/public
[Homes] I have not specified a path, and all linux users that can log on have their own root directories.
IV. samba password file setting and user password setting
View copy print?
[Root @ samba etc] # cat/etc/passwd | mksmbpasswd. sh>/etc/samba/smbpasswd
[Root @ samba etc] # chmod 500/etc/samba
[Root @ samba etc] # chmod 600/etc/samba/smbpasswd
[Root @ samba etc] # smbpasswd-a zhangy
Convert unencrypted/etc/passwd files into encrypted smbpasswd files. Based on the confidentiality principle, set the/etc/samba directory permission to 500 and the file permission to 600 to prevent others from obtaining the password file.
Zhangy is a system user and has a linux password, but it cannot be used to connect to samba. Therefore, use smbpasswd to reset the password.
5. start the samba server and connect to the client
[Root @ samba etc] #/etc/init. d/smb start
Client connection: [start] = "[run] =" [cmd] press enter \ 192.168.1.108 \ public. If you only enter \ 192.168.1.108, the user and password are required to enter the personal user directory by default.
VI. samba shared directory, ing windows drive letters
The following is a ing using the Windows 7 player. Security = user, that is, password.
[Computer] =, right-click Network =, [ING network drive (N)...] =