Home > Backend Development > PHP Tutorial > Linux and Windows tie the knot_PHP Tutorial

Linux and Windows tie the knot_PHP Tutorial

WBOY
Release: 2016-07-13 17:11:45
Original
828 people have browsed it

As a new thing, Linux has attracted a lot of attention, but whether it can share resources with Windows quickly and conveniently is a very important issue. As we all know, Windows can use "Network Neighborhood" to share resources, and Linux can use NFS to share resources. So, what about Linux versus Windows?
Linux can communicate with Windows hosts through Samba. Samba adopts the Client/Server architecture. By executing the Samba client program, you can access shared resources on the Windows host; and by running the Samba server, the Windows host can access shared resources on Linux. The following takes Red Hat 8.0 as an example to introduce how to access Windows shared resources in a Linux environment.
Install Samba
If you are not sure whether the Samba package has been installed, you can execute the following command in the terminal window to query:
$ rpm -qa | grep samba
If the query results appear as shown in Figure 1 The three software packages shown indicate that the Samba software package has been installed.

Figure 1: Check whether the Samba software package is installed
If the Samba software package has not been installed, you can insert the second installation CD of Red Hat 8.0, and then follow the steps below to install it (using the KDE environment as Example):
1. Click the main menu→System Settings→"Software Package" menu item in sequence, and the "Software Package Management" dialog box will open.
2. Find "Windows File Server" in the dialog box, make sure this option is checked, and then click the "Update" button at the bottom of the dialog box, as shown in Figure 2.
 3. Install the Samba software package.

Figure 3: Installing Samba software package
The whole process is very simple. The system will automatically detect the dependencies between software packages, so you don’t have to worry about it at all.
Use command mode to access Windows
After installing Samba, you can let it show its talents. Here we first introduce how to use character commands to access Windows shared resources.
 1. Query the shared resources of the Windows host
To query the shared resources of the Windows host, you can use the smbclient -L WindowsHostName command. For example, to query the shared resources on a Windows host named Peter, you can enter in the terminal window:
smbclient -L Peter
and then press Enter. The specific usage of this command is shown in Figure 3. This command can accurately check out the shared folders of Windows hosts, and has good support for Chinese file names.

Figure 3: Query the shared resources of the Windows host
2. Connect to the shared directory of the Windows host
We can use the "smbclient //WindowsHostName/ShareName" command to connect to a share on the Windows host folder. If the shared folder requires a username and password, you can use the "smbclient //WindowsHostName/ShareName -U UserName" command. For example, to connect to the shared directory Share on the Windows host Peter, you can enter in the terminal window:

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629582.htmlTechArticleAs a new thing, Linux has attracted a lot of attention, but can it quickly and easily share resources with Windows? , is a very important question. As we all know, Windows can use...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template