At work sometimes we need to mount the Windows shared directory on Linux. First we need to learn to view Windows on Linux to share those directories. The view operation requires the installation of samba-client.
[Email protected]5201351yuminstall samba-client-y // Installing the Samba client
After installing Samba-client, the next step is to look at the shared resources on the Windows host and see the following commands:
[Email protected]5201351192.168. 100.1 -u Administrator // displays a list of all resources shared by the server,-U is the specified user name
The author's test results are as shown, where Share-test is a directory shared on my Windows host:
The above command is only the query server shared those resources, we also need to consider how to attach resources to the local, easy to add and delete changes, we can use the following command to mount.
[Email protected]5201351Mount -t cifs-o username=administrator,password=123456// 192.168.100.1/share-test/mnt/windows
Where cifs is the mount type, CIFS is the abbreviation for the Common internet file system, and the Universal Internet filesystem
Network file sharing between Windows hosts is achieved by using Microsoft's own CIFS service .
in the command above //192.168.100.1/share-test is a shared directory on the Windows Server side.
The contents of the Share-test directory shared on Windows are also mounted to the/mnt/windows directory under Linux.
This command mounts the shared directory after the restart will expire, if you want to take effect every time, you can add the following at the end of the /etc/fstab file:
// 192.168.100.1/share-test/mnt/windows cifs defaults,username=administrator,password=123456 0 0
Mount Windows shared directory under Linux system