How to make CentOS 6.5 read windows shared folders

Source: Internet
Author: User
Tags centos centos server

Because of work requirements, you need to share the local folder and then temporarily use it on the CentOS server.

The server uses the CentOS system, while the local machine uses the win7 system. For temporary use, we do not plan to build FTP and Samba servers, but directly Mount windows shared folders through CentOS.

Since windows shared folders are used, we must first create a shared directory on the local machine. As follows:

 

 

Note that the permission we share with the administrator is the read/write permission. We will test this permission in the CentOS system.

 

After the shared folder is configured, access the shared folder on another machine to check whether the shared folder is successful. As follows:

192.168.1.126

 

We can see from the figure above that this share can be accessed normally.

Now we can mount it on CentOS with the following command:

Mount-t cifs-o username = administrator, password = @ // 192.168.1.126/789/share/

 

As shown in the preceding figure, the shared folder has been successfully attached to the server.

Cifs in this command represents the Microsoft cifs protocol.

If you want to enable the sharing to be automatically mounted after CentOS is started, you can edit the/etc/fstab file and add the following command:

// 192.168.1.126/789/iso cifs auto, username = administrator, password = @ 0 0

You can also use the following command:

Echo "// 192.168.1.126/789/share cifs auto, username = administrator, password = @ 0 0">/etc/fstab

 

To cancel mounting, run the following command:

Umount/iso

 

The following describes how to mount and detach windows shared folders. We will test the permission of shared folders.

Note that in the preceding command, we mount the shared object to use the administrator user. As mentioned above, the administrator user has read and write permissions on the shared folder.

Now let's create a new directory and file, as shown below:

Mkdir/share/testdir

Touch/share/testfile. sh

 

 

Using the two screenshots above, we found that the permission is indeed the same as the one we used to share folders and has the read and write permissions.

This article describes how to mount windows shared folders on CentOS.

Related Article

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.