Summary
On a network, there may not only only Linux systems, there will be other operating systems such as Windows NT, Windows95. How to make these machines that install different operating systems for document-level resource sharing? Below we will discuss this issue. (2002-09-16 13:35:22)
By Wing, Source:
Fjxufeng
On a network, there may not only only Linux systems, there will be other operating systems such as Windows NT, Windows95. How to make these machines that install different operating systems for document-level resource sharing? Below we will discuss this issue. 9.1 Let Linux become a file server - Install Samba Server 9.1.1 What is Samba Samba to imagine file servers on a local area. It can provide file services and print services for customers (such as Win95, WinNT, etc.) in the same network. That is, the Samba server allows the Linux implementation icon to the functionality of the Novell NetWare file server. 9.1.2 SAMBA Working Principle Samba Working is that the two protocols of NetBIOS (Windows95 Network Neighborhoods) and SMA (Server Message Block) are running over the TCP / IP Communication Protocol and uses Windows 95 NetBeui protocols. Let Linux can be seen by Windows 95 on the network neighbor. The most important of these is the SMB protocol (Server Message Block), which is a protocol for sharing printers, serial ports, and communication abstractions (such as named pipes, mail slots, etc.) between different computers. The SMB protocol is a very important agreement that is widely used in all Microsoft Windows series operating systems. Samba is an implementation of the SMB server on the class UNIX system. It is a GPL free software for open source code. Current Samba can run on almost all UNIX variants. 9.1.3 Installing the Samba Server In the Redhat Linux operating system, as long as Samba is selected, it will install Samba while installing Linux. If you don't have selected, you can also find the Samba RPM installation package on the CD, you can install it with RPM. 9.1.4 Configuring Samba Configuring Samba is actually the corresponding settings for its profile SMB.conf. SMB.conf is related to the permissions settings of the Samba server, as well as a variety of detailed options such as the working group to which the shared directory, the workgroup belongs to the machine. The syntax of the file SMB.conf is very clear. The file is divided into sections, and each paragraph encloses in a square bracket. Set the parameters with the "Name = Value" in each period. The front plus segment indicates that the sentence is comment. In the following story, we only explain the most commonly used parts, and more in-depth settings, please read the comment segment of this file. The entire configuration file is most basic for three special sections. 1. Global Segment: Configure the parameters used throughout the process and provide default values for other segments.
[global]
Workgroup = mygroup;
Hosts allow = 192.168.1. 192.168.2. 127.
PrintCap Name = / etc / printcap
Load Printers = YESLOG
FILE = /VAR/LOG/SAMBA/LOG.%M
1) The first sentence Workgroup is used to specify the working group where the machine is located in the network neighbor. The default is MyGroup, you can make a corresponding modification according to your favorite. 2) And Hosts Allow is a description used to designate which machines can be described in the LAN. In general, there is no need to set it, so the most in front of ";" start, indicating this comment out. 3) The third sentence is to tell Samba, the location of the printer name. 4) Chapter 4 Load Printers = YES is telling the Samba server to allow all printers to be browsed. 5) The last sentence is the stored address of the log log file. 2. HOMES segment: This section is used to represent the user's home directory that allows the client. There is no specific content of this directory in the SMB.conf file. When a service request is issued, you look for this specific service at other parts of the SMB.conf file. If this service is not found, the HOMES segment is provided, search the password file will find the home directory of the user. By breaking down the HOMES segment, Samba uses the home directory as a share. Below is the most basic settings of this section. [homes]
Comment = Home Directory
Browseable = no
Writable = yes
1) Where the Comment software can be shared on the server. 2) BrowSeable Sets whether Samba is displayed on the web browsing table, it is recommended to change to browseable = yes. 3) The last sentence is to indicate whether there is write authority. 3. PRINTERS segment: Set the sharing of the printer. The sample is as follows:
[printers]
Comment = all printers
Browseable = no
Printable = yes
It is recommended to change browseable = no to browseable = yes. In general, the most basic settings have been made in the default SMB.conf file, which can be applied in a variety of situations without modification. Therefore, it is recommended that beginners can modify it. Of course, if necessary, you can refer to the comment statement for some attempts. That is, if you don't make modifications to SMB.conf, the client has been able to use the most basic Samba service. 9.1.4 There are two ways to start the Samba server to start the Samba server. One is a Standalone mode, the other is INTED mode:
Starting mode occupies resource response speed
STANDALONE mode is more fast
INTED mode is slow
We recommend using the Inted mode to launch the Samba server. It should be noted that we cannot use two ways to run at the same time, otherwise the Samba service will not be unacceptable. And this startup method is also used by default. 1. When starting using the INTED mode, you will add the following lines in the / etc / service file:
NetBIOS-NS 137 / TCP
NetBIOS-NS 137 / UDP
NetBIOS-DGM 138 / TCP
NetBIOS-DGM 138 / UDP
NetBIOS-SSN 139 / TCP
NetBIOS-SSN 139 / UDP
The following lines have also been added in the /etc/inetd.conf file:
NetBIOS-SSN Stream TCP NOWAIT ROOT / USR / SBIN / SMBD
SMBDNETBIOS-NS DGRAM UDP WAIT ROOT / USR / SBIN / NMDB NMDB
If you want to start with the next way, add a comment symbol "#" in front, then execute the inetd command to take effect. 2. Start using the Standalone method If you want to start using this way, add the following lines in the /etc/rc.d/rc.local file: Echo "Startting Samba Server ..."
/ usr / local / samba / bin / smbd -d -d1
/ usr / local / samba / bin / nmbd -d -d1 -n linux
9.1.5 Using Samba Services Take Windows 9X as an example, we can find a new working group MyGroup, and this Linux host will be found below. We can use Samba service. 9.2 Network File System NFS Please select NFS when you install Linux, so that the Linux system is installed in the system. Then we can easily use it very much. 9.2.1 Sharing Linux files are simple to share Linux through NFS, as long as the / etc / exports file is modified. For example, we want to share the / home / nfstest directory to 202.101.55.5 machine, and give it read, write permissions, then just write the following information to / etc / exports this file.
/ HOME / NFSTEST 202.101.55.5 (RW) 9.2.2 Sliding the shared file in Linux then, if we can hang in / home / nfstest in this machine (202.101.55.1) in 202.101.55.5. We only need to perform the commands:
Mount -t NFS 202.101.55.1:/HOME/nfstest / MNT / NFSTEST is hung down on the / home / nfstest directory on 202.101.55.5 in / mnt / nfstest catalog.