Play Samba server Samba to build a whole process

  

Samba is a software that allows Linux system to apply Microsoft network communication protocol, and SMB is the abbreviation of Server Message Block, which is server message block, SMB is mainly used as Microsoft network The communication protocol, and later Samba applied the SMB communication protocol to the Linux system, and formed the current Samba software. Later, Microsoft renamed SMB to CIFS (Common Internet File System), which is a public Internet file system, and added many new features, which made Samba more powerful. Samba's biggest feature is that it can be used for direct file sharing and print sharing between Linux and Windows. Samba can be used for file sharing between Windows and Linux, as well as for resource sharing between Linux and Linux. Network file system) can do a good job of data sharing between Linux and Linux, so Samba is more used in data sharing between Linux and Windows. SMB is a client/server based protocol. Therefore, a Samba server can act as both a file sharing server and a Samba client. For example, a Samba server that has been set up under Linux, the windows client. The SMB server can share the resource files on the Samba server. At the same time, the Samba server can also access files shared by other windows systems or Linux systems on the network. Samba uses the NetBIOS protocol under Windows. If you want to use the files shared under Linux, please confirm whether the NetBIOS protocol is installed under your windows system.

Samba Installation and Configuration

Our system environment is: Operating System
: Red Hat Enterprise Linux Server release 5.1 Samba Server IP Address: 192.168.60.231Samba Version: Samba-3.0.23c-21. Installing samba Almost all Linux distributions come with the samba package by default. Log in to the system and check if the Samba software is installed. Do the following: [root@localhost ~]# rpm -q samba samba-3.0.23c-2 If there is a display, it means that Samba is already installed on the system. If there is no display, please go to the system CD to find the corresponding Samba package and install it. Samba installation is very simple, the installation process is as follows: [root@webserver ~]# rpm -ivh samba-3.0.23c-2.i386.rpm warning: samba-3.0.23c-2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186Preparing... ###################################################### # [100%]1:samba ############################################################## # [100%] After the Samba server is installed, it will generate the configuration file directory /etc/samba and some other samba executable command tools. /etc/samba/smb.conf is the core configuration file of samba, /etc/init.d/Smb is the samba startup/shutdown file. 2. The composition and use of the Samba service consists of two services that are composed of Samba. One is SMB and the other is NMB. SMB is the core startup service of Samba. Only the SMB service is started to share files, and the NMB service is responsible for parsing. Similar to the function implemented by DNS, NMB can associate the working group name shared by the Linux system with its IP. If the NMB service is not started, the shared file can only be accessed through IP. For example, if the IP address of a Samba server is 192.168.60.231 and the corresponding workgroup name is ixdba, you can access the shared file by entering the following two commands in the IE browser of Windows
. In fact, this is the way to view the shared files of the Linux Samba server under Windows
. \\\\192.168.60.231\\Share directory name \\\\ixdba\\Share directory name You can start, shut down, and restart the Samba service by /etc/init.d/smb start/stop/restart. The SMB service is started as follows: [root@ Localhost Linuxdata]# /etc/init.d/smb startStarting SMB services: [ OK ]Starting NMB services: [ OK ] From the boot output, it can be seen that the SMB boot includes both SMB and NMB services. So when Linux is used as a client, what should you do when viewing files shared by other Linux Samba servers? This requires the smbclient tool. The system comes with this command by default. The common usage of Smbclient is described below. (1) View the shared data of the Samba server Smbclient – L //Samba server ip address - U Samba user name & ldquo; - L & rdquo; that is the meaning of the list, & ldquo; - U & rdquo; is the meaning of user, if the Samba server is If you do not have password access, you can omit the <;U Samba username”. For example: when samba needs a password to log in, view the sharing method as follows: [root@web ~]# smbclient -L //192.168.60.231/Linuxdata –U adminPassword: Enter the admin password here. When Samba has no password access, execute the following command: [root@web ~]# smbclient -L //192.168.60.231/LinuxdataPassword: Just press Enter. (2) Log in to the Samba server If you need to log in to the Samba server on the Linux client, use the following: Smbclient //Samba server ip address - U Samba user name Please see the following operation: [root@web samba]# smbclient //192.168 .60.231/LinuxdataPassword: Domain=[IXDBA.NET] OS=[Unix] Server=[Samba 3.0.23c-2]Server not using user level security and no password supplied.smb: \\> ls. D 0 Thu Feb 19 23:49:33 2009.. D 0 Thu Feb 19 19:05:24 2009install.log 36563 Thu Feb 19 23:49:22 2009install.log.syslog 4295 Thu Feb 19 23:49:22 200958113 blocks of size 262144. 44294 blocks availablesmb: \\> ? #Enter here to see all the commands available on the smb command line. Altname archive blocksize cancel case_sensitive cd chmod chown close del dir du exit get getfacl hardlink help history lcd link lock lowercase ls mask md mget mkdir more mput newer open posix posix_open posix_mkdir posix_rmdir posix_unlink print prompt put pwd q queue quit rd recurse reget rename reput rm Rmdir showacls setmode stat symlink tar tarmode translate unlock volume vuid wdel logon listconnect showconnect ! smb: \\> see it, is it similar to logging in to the FTP server, after logging in to the Samba server, you can upload and download files, if With sufficient permissions, you can also modify the file operation. In addition, the files shared by the Samba server can also be mounted on the Linux client. This requires the mount command as follows:

Copyright © Windows knowledge All Rights Reserved