Linux and NT network integration using Samba

Source: Internet
Author: User
Article title: Linux and NT network integration using Samba. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Hu Dian
  
Linux and Windows are popular operating systems, which exist in the intranets of many enterprises at the same time. To improve resource utilization, you need to be able to share resources between these different systems. for example, you can access the shared folder or print device of the Linux server from a Windows client, or use the disk space and printer of the Windows server from the Linux client. Therefore, you need to integrate Linux and Windows networks.
There are many methods for implementing network integration between Linux and Windows. the main three methods are as follows:
● Simple communication: telnet, FTP, HTTP, and other commands and protocols are used for inter-network communication;
● Network File System NFS: NFS can share resources between Unix hosts and between Linux and Windows hosts;
● SMB protocol: you can easily implement network integration by installing server and client software that supports SMB on a Linux host.
At this stage, most small and medium-sized local area networks (LAN) in China are dominated by Windows NT/2000, and most users are familiar with Windows operating platforms. At the same time, more and more organizations want to use Linux with better performance and price ratio as gateways and network servers to build enterprise network (Intranet) and access the Internet. Among the above solutions, SMB-based integration solutions have become the first choice for enterprises because of their advantages such as simplicity, transparency, and low cost. The outstanding advantage of this method is that the Linux host is directly integrated into the Windows network.
SMB protocol and Samba
The SMB protocol is used to share documents, printers, and other computer resources between computers in the LAN.
On Linux or Unix platforms, there are many software that supports SMB protocol, among which Samba is popular. Using it, people can easily integrate Linux with Windows networks. Samba is composed of a set of kits, including SMB server (smbd), NetBIOS server (nmbd), SMB client (smbclient), and other tools.
Samba installation
1. install
After logging on as a root user, run the command "ps-x" to check whether smbd and nmbd processes exist in the system. If yes, enter the command to disable all SMB processes:
/Etc/rc. d/init. d/smb stop
Remove the old Samba versions:
Rpm-e Samba
Finally, install the new Samba (assuming it is in the/home/myfiles directory)
Rpm-I/home/myfiles/smbfs-2.0.7-20000425. ifiles. rpm.
2. start
After the installation is successful, you can start Samba in several ways. The manual start method is as follows:
Enter the following command:
/Usr/sbin/smbd-D
/Usr/sbin/nmbd-D
Or enter the following command:
/Etc/rc. d/init. d/smb start
If you need to put the Samba server in inetd for execution, you can add the following statement to the/etc/inetd. conf file:
# SAMBA NetBIOS services
Netbios-ssn stream tcp nowait root/usr/sbin/smbd
Netbios-ns dgram udp wait root/usr/sbin/nmbd
Last run:
/Etc/rc. d/init. d/inet restart
Configure the Samba Server
The configuration information of Samba is stored in the smb. conf file. Configuration information is divided into two parts: the first part is the global parameter area [globals], which sets some public information; the second part is the resource sharing area, which sets the Directory resources output by the server and print resources. You can define shared directories or print resources as needed.
The following is a simple example to illustrate the use of smb. conf (as shown in ).
  
System structure
Myserver is a Linux samba Server. it outputs the local printer as the network printer lp and the local directory/tmp as the shared directory pubdir. You can also access your Linux home directory. The following is its smb. conf file:
[Global] # global parameter area
Workgroup = mynet # Working Group name or NT Domain name server string = Samba Server # server annotation printcap name =/etc/printcap # load printer
Load printers = ye
Security = user
Encrypt passwords = yes
Smb passwd file =/etc/smbpasswd [homes] # User's main directory
Comment = Home Dictories
Browseable = no
Writable = yes
[Printers] # configure a network printer
Path =/var/spool/samba # fake offline path browseable = no
Public = yes
Writable = no
Printable = yes
[Pubdir] # shared directory
Path =/tmp # directory path
Public = yes
Writable = yes
Printable = no
After modification, you can run testparm to check whether the configuration is successful.
After configuring smb. conf, you also need to add users of the Samba server. The default security level of Samba is user level (security = user). Therefore, Samba users must be Linux users. Log on as a root user, add a Linux user, and set the password:
Adduser smbuser
Passwd smbuser
Add the user smbuser to the Samba Server user and set the password:
Smbpasswd-a smbuser
Restart the Samba server. In this case, you can use myclient to browse and access resources on Linux.
Use the Samba client
There are many client tools that support SMB. generally, for Windows 9x/NT/2000 platforms, you only need to install TCP/IP to access the Samba server. Smbclient is an SMB client tool in Linux. For example, access \ myserver \ pubdir resources on the SMB server myserver:
Smbclient \\\\ myserver \ pubdir
At this time, the system will enter the Samba interaction interface, which is similar to FTP operations, such as entering ls to list resource directories, entering get to copy files to the local device, and entering help to list command help.
  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.