Sharing with Ownership of a Server User
Another way of using the Shared Folders functionality is to configure your system so that a shared folder has the same owner and group as it has on the physical server. To enable this option for your system:
-
Open the
/etc/fstab
file for editing.
-
Locate the Shared Folders line:
none /media/psf prl_fs sync,nosuid,nodev,noatime,share,context=system_u:object_r:removable_t:s0,nofail
-
Replace the
share
option with the
plain
one, or if the former is not present, just add the
plain
option to the line:
none /media/psf prl_fs sync,nosuid,nodev,noatime,plain,context=system_u:object_r:removable_t:s0,nofail
-
Save the file.
Now if you share the
/home/SharedFolder
directory that contains the files
1.txt
and
2.txt
and is owned by the
greg
user and the
greg
group and mount it to the
/media/psf/Shared
directory in the
MyVM
virtual machine, both files will have
greg
as the owner and group owner in the virtual machine:
# ls -l /home/SharedFolder
total 4
-rw-r--r-- 1 greg greg 143 May 4 15:15 1.txt
-rw-r--r-- 1 greg greg 0 May 4 19:04 2.txt
[bob@dhcp-10-30-21-207]$ ls -l /media/psf/Shared
total 4
-rw-r--r--. 1 greg greg 143 May 4 19:04 1.txt
-rw-r--r--. 1 greg greg 0 May 4 19:04 2.txt
|