Linux CentOS7 access window shared folder

1 Make sure that the folder shared by the window can be accessed

First , enter

\\192.168.137.1 in the window operation to

see if there is a shared folder


2 Mount on CentOS, use the following command

[root@localhost /]# mount -t cifs -o username=xyf,password=123 //192.168.137.1/ /media/share/

where share is a new folder

3 Check if the mount is successful

ls /media/share/

This shared folder has been successfully mounted on the server load.

The cifs in this command represents Microsoft's cifs protocol.

If you want to make CentOS automatically mount the share after booting, 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

or use the following command You can also:

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

4 To cancel the mount, use the following command:

umount /media/share


I explained above The mounting and unmounting of the windows shared folder, let's test the permissions of the shared folder.

Note that in the above command, we use the administrator user to mount the share. We have already mentioned that the administrator user has read and write permissions to the shared folder.

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

mkdir /share/testdir

touch /share/testfile.sh

Through the above two screenshots, we find that the permissions are indeed the same as those we gave to the shared folder before, with read and write permissions.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326418809&siteId=291194637