The server uses a CentOS system, and the Win7 system is used by the machine. Considering the temporary use, it is not intended to build an FTP and Samba server, directly through the CentOS Mount Windows shared folder way to achieve this purpose .
Now that we are using Windows shared folders, we must first create a shared directory on this machine. As follows:
650) this.width=650; "title=" clip_image001 "border=" 0 "alt=" clip_image001 "src=" http://blog.chinaunix.net/ Attachment/201409/11/21710354_1410409705apk9.png "width=" 573 "height=" 465 "style=" Border:0px;background-image: none;padding-top:0px;padding-left:0px;margin:0px;padding-right:0px; "/>
650) this.width=650; "title=" clip_image002 "border=" 0 "alt=" clip_image002 "src=" http://blog.chinaunix.net/ Attachment/201409/11/21710354_1410409705f9qc.png "width=" 649 "height=" 513 "style=" Border:0px;background-image: none;padding-top:0px;padding-left:0px;margin:0px;padding-right:0px; "/>
It is important to note that the share permissions we give to administrator administrators are read-write permissions . Wait, we'll test this permission in the CentOS system.
650) this.width=650; "title=" clip_image003 "border=" 0 "alt=" clip_image003 "src=" http://blog.chinaunix.net/ Attachment/201409/11/21710354_1410409706vjf5.png "width=" 628 "height=" 498 "style=" Border:0px;background-image: none;padding-top:0px;padding-left:0px;margin:0px;padding-right:0px; "/>
After the shared folder configuration is complete, we now access this share on other machines to see if it can succeed. As follows:
\\192.168.1.126
650) this.width=650; "title=" clip_image004 "border=" 0 "alt=" clip_image004 "src=" http://blog.chinaunix.net/ Attachment/201409/11/21710354_1410409706ac58.png "width=" 668 "height=" 523 "style=" Border:0px;background-image: none;padding-top:0px;padding-left:0px;margin:0px;padding-right:0px; "/>
As we can see, this share is already available for normal access.
Now we mount on CentOS, using the following command:
Mount-t cifs-o Username=administrator,[email protected]//192.168.1.126/789/share/
650) this.width=650; "title=" clip_image005 "border=" 0 "alt=" clip_image005 "src=" http://blog.chinaunix.net/ Attachment/201409/11/21710354_1410409707d7rz.png "width=" 901 "height=" 375 "style=" Border:0px;background-image: none;padding-top:0px;padding-left:0px;margin:0px;padding-right:0px; "/>
As we can see, this shared folder has been successfully mounted on the server.
The CIFS in this command represents the CIFS protocol of Microsoft.
if you want to automatically mount the share after you start the CentOS boot, you can edit /etc/fstab file, add the following command:
192.168.1.126/789/iso CIFS Auto, Username=administrator,[email protected] 0 0
Or you can use the following command:
echo "//192.168.1.126/789/share cifs Auto,username=administrator,[email protected] 0 0" >>/etc/fstab
650) this.width=650; "title=" clip_image006 "border=" 0 "alt=" clip_image006 "src=" http://blog.chinaunix.net/ Attachment/201409/11/21710354_1410409708aall.png "width=" 1096 "height=" "style=" Border:0px;background-image: none;padding-top:0px;padding-left:0px;margin:0px;padding-right:0px; "/>
To cancel the mount, use the following command:
Umount/iso
650) this.width=650; "title=" clip_image007 "border=" 0 "alt=" clip_image007 "src=" http://blog.chinaunix.net/ Attachment/201409/11/21710354_1410409708jlj2.png "Width=" 510 "height=" 171 "style=" Border:0px;background-image: none;padding-top:0px;padding-left:0px;padding-right:0px; "/>
The above I explain the Windows shared folder mount and uninstall, below we to test the permissions of the shared folder.
Note that in the above command, we mount the share using the administrator user, which we have mentioned before administrator users have read and write access to the shared folder.
Now let's look at a new directory and file, as follows:
Mkdir/share/testdir
touch/share/testfile.sh
650) this.width=650; "title=" clip_image008 "border=" 0 "alt=" clip_image008 "src=" http://blog.chinaunix.net/ Attachment/201409/11/21710354_14104097097tn7.png "width=" 901 "height=" 243 "style=" Border:0px;background-image: none;padding-top:0px;padding-left:0px;margin:0px;padding-right:0px; "/>
650) this.width=650; "title=" clip_image009 "border=" 0 "alt=" clip_image009 "src=" http://blog.chinaunix.net/ Attachment/201409/11/21710354_1410409709utao.png "width=" 996 "height=" 258 "style=" Border:0px;background-image: none;padding-top:0px;padding-left:0px;padding-right:0px; "/>
With the above two, we found that the permissions are indeed the same as we gave the shared folder, with Read and write permissions.
This article describes the contents of the CentOS Mount Windows shared folder.
CentOS Mount Windows shared folder