About Samba Services
Samba is a free software that implements the SMB protocol on Linux and UNIX systems, consisting of servers and client programs. SMB (Server Messages block, information service blocks) is a kind of communication protocol for sharing files and printers on LAN, which provides shared services of files and printers among different computers in LAN. The SMB protocol is a client/server protocol that allows clients to access shared file systems, printers, and other resources on the server. By setting up "NetBIOS over TCP/IP", Samba will not only share resources with local network hosts, but also share resources with computers around the world.
Environment
Redhat 6.5
ip:192.168.10.100
Hostname:zred
Win7
ip:192.168.10.50
Identify two machines connected to each other
Anonymous configuration steps
First install Samba
# rpm-ivh/sr0/packages/samba-3.6.9-164.el6.x86_64.rpm
Adjusting the configuration file
To be safe, back up the configuration file first
# MV Smb.conf SMB.CONF.BK
# grep-v "#" SMB.CONF.BK > smb.conf
Start modifying
#vim smb.conf
Anonymous access
Access settings
Change folder permissions
# chmod 777/opt/a
Shutting down firewalls and SELinux
Start the service
# service SMB Start
Test
Write a file in, and then view it on the server.
Success!
?
Account Mapping
First add a map list
# Vim Smbusers
Add the SMB password to the ZZ user, and the normal password will prevent you from signing in
Change the master configuration file
#vim smb.conf
Change these two points.
Add at end of line
Restart Service
Detection
Success!
?
?
Report:
Master configuration file
[Global] Global configuration workgroup = MyGroup [homes]// home directory sharing [printers] //Printer Sharing [a] path =/smb/ //shared directory path ; public = Yes|no //default no; browseable = yes|no //default Yes, can browse; Read only = yes|no//default yes; writable = Yes|no //default yes; writable Write list = user //default none; Writable user list Valid users = user,user1//default All Users ; A valid list of users; Hosts allow = Client address //allowed client address; Hosts deny = Client address //Forbidden client address; Comment = Comment //description
Errors that may occur during the process
1. When the client logs on to samba, the following prompt appears: Session setup failed:nt_status_logon_failure The error indicates that the user is wrong, either the user does not exist or the password is incorrect. Or just in the Samba user and system user and password errors, in short, the user and password issues. Tree Connect Failed:nt_status_bad_network_name This error indicates a bad network name, indicates that the shared directory does not exist, or the shared directory permissions issue is available setfacl-m to the user with permission connection to 192.168.4.7 failed (Error nt_status_host_unreachable) 2. The following prompt appears when the client connects to the Samba shared directory: SMB: \> lsnt_status_access_denied Listing \* file permissions are insufficient, or there is a selinux limit to adjust the file permissions, and open SELinux switch 3, perform setsebool-p operation to enable the SELinux switch parameter failure, prompt: Killed memory is low, And there's not enough swap space. Add swap partition (1GB) in retry
Samba file sharing service configuration and user mapping in Linux