Samba, with UNIX-based micro-series for Windows for the Department of SMB / CIFS (Server Message Block / Common Internet File System) Road custom freedom. Third Edition and can not access the SMB share materials and printers, can integrate itself into the Windows Server domain, playing field control station (Domain Controller) and added to Active Directory. Speaking, this in the WindowsUNIX put up a series OS, there's source interoperable.
Samba is a multi-service and comprising NetBIOS (NBT) TCP / IP on, SMB, CIFS (SMB version of increase), DCE / RPC or more MSRPC (home kit), a WINS server is (also for NetBIOS Name Server (NBNS)), NT domain kit (includes NT domain Logons, Secure Accounts Manager (SAM), Local Security Authority (LSA) service, NT-style printing service (SPOOLSS), NTLM, and includes a change of Kerberos close out change of type mesh (LDAP) in the Active Directory Logon service). And often more than some clothes to NetBIOS or SMB. Samba can also be used for shared printing.
Here to explain a little CIFS, it works at 137 / UDP, 138 / UDP, 139 / TCP, 445 / TCP, you may think that how it works on so many ports, which in fact it uses the NBT (NetBIOS over TCP / IP) and work on the TCP protocol.
NBT use 137, 138 (UDP) and 139 (TCP) to achieve based on TCP / IP, NETBIOS internetworking. In Windows NT SMB-based NBT implementation. And in Windows2000, SMB-based NBT in addition to implementation, as well as directly through 445 ports. When Win2000 (allows NBT) as a client to connect to the SMB server, it will also attempt to connect 139 and 445 port, port 445 if there is a response, it sends a RST packet to port 139 is disconnected in order to continue the communication port 455. When when port 445 is not responding, only use 139 port. When Win2000 (Prohibition NBT) as a client to connect to the SMB server, it will try to connect to port 445, if there is no response, then the connection fails. (Note that the other side may be NT4.0 server.) If the win2000 server allows NBT, then UDP ports 137, 138, TCP port 139, 445 will be open. If NBT is disabled, then only open 445 ports.
Of course, it looks like, in fact, Windows Network Neighborhood Bale.
On CentOS6.6 default installation smbclient, it is used in two ways:
[Root @ localhost ~] # smbclient -L 192.168.1.103 -U test # test is a user on Windows
[Root @ localhost ~] # smbclient //192.168.1.103/test -U test
Mounting method for accessing the file system:
[Root @ localhost ~] # mount -t cifs //192.168.1.103/test / mnt -o username = test [, password =]
Samba server directly using the yum install just fine:
[Root @ abctest~] # yum install samba
/ Etc / openldap / schema
/etc/rc.d/init.d/nmb# service script
/etc/rc.d/init.d/smb# service script
/etc/samba/smb.conf# master configuration file
/ Etc / samba / smbusers
/ Usr / bin / eventlogadm
/ Usr / bin / smbstatus
/ Usr / sbin / nmbd
/ Usr / sbin / smbd
Account: all users of the system, / etc / passwd
Password: Samba service their own password files
The users of the system is converted to a command smbpasswd Samba
[Root @ abctest~] # vim /etc/samba/smb.conf
4 workgroup = WORKGROUP # because Windows workgroup so here is the need to change
[Root @ abctest~] # useradd smbuser1
[Root @ abctest~] # smbpasswd -a smbuser1
-d: Disable Account
-e: Enable Account
-x: Delete Account
Its default shared directory for the user's home directory
After setting up Windows network neighborhood then you can see:
Its shared directory for the user's home directory.
Configuration file: smb.conf
Set specific shared directory
Private home directory
256 comment = My Samba Testing. # Annotations
257 path = / shared / samba # shared directory
258 browseable = yes # Allow users to browse the non-owner
259 guest ok = yes # if run guest account access
260 writable = no # is writable
public = yes
readonly = yes
write list = + staff #staff users within the group can write
[Root @ abctest~] # testparm # test configuration file is correct, and the final content of the entry into force
[Root @ abctest~] # setfacl -m u: smbuser1: rwx / shared / samba / # of the directory's permissions depend on the intersection of Samba permissions and file system permissions
At this point smbuser1 of samba directory is not writable
We speak write list = + smbuser1 added to the configuration file [samba] configuration section you can create a document
OK, Samba is so simple, then we look for the Samba web version of GUI interface, which is called samba-swat package on CentOS expansion disc.
[Root @ samba ~] # yum install -y samba-swat
[Root @ samba ~] # rpm -ql samba-swat
/etc/xinetd.d/swat # xinetd process it is on the inside
[Root @ samba ~] # vim /etc/xinetd.d/swat
1 # default: off
2 # description:. SWAT is the Samba Web Admin Tool Use swat \
3 # to configure your Samba server. To use SWAT, \
4 # connect to port 901 with your favorite web browser.
5 service swat
7 port = 901
8 socket_type = stream
9 wait = no
10 only_from = 192.168.1.0/24
11 user = root
12 server = / usr / sbin / swat
13 log_on_failure + = USERID
14 disable = no
[Root @ samba ~] # service xinetd restart
[Root @ samba ~] # ss -tnl | grep: 901
LISTEN 0 64 ::: 901 ::: *
So you can use the browser to access the
There are a lot of use of the document, in great detail we are interested can look at yourself.
SHARES we have in sharing information, where the Advanced mode there are many options to choose, and if a click Commit Changes here will overwrite the contents out of it in /etc/samba/smb.conf.
STATUS STATUS We have Samba server information and service control buttons.