MacOS – How to mount a shared folder as disk with `rwxr-xr-x` permissions

afpmacosmountpermissionsharing

I shared a folder from the host system (OSX) and use mount it in the guest system (OSX). But it is mounted only with rwx------ mode. I granted an rw access for the shared folder for a user in the guest system and for everyone as read-only. But in the guest system the folder is going mounted to the /Volumes/ as a shared disk with rwx------ permissions. How can I mount it with rwxr-xr-x permissions?

Update 1:

in the host system it has rwxr-xr-x+ permissions

Update 2:

the problem sounds to be like here: permissions for mounted internal disk [ask ubuntu]. So is it kind of related to fmask, dmask (umask)?

Update 3:

here is similar situation, but on linux 700 instead of 755 permissions on auto-mounted USB HDD. so there is a /etc/fstab.hd file on osx but it considered be useless

Update 4:

it looks like all AFP shares appears as drwx------. How to change it?

Best Answer

You need to specify the permissions when executing mount - the local file permissions or the permissions you set with chmod on the directory to which you mount your share will not be taken into consideration.

You should do mount -t <fs_type> -o m=755 /path/to/source /destination

I'm not sure which filesystem type is what you're trying to mount (is it nfs? or hfs?) - you only refer to a host system and a guest system without any more details. You'll need to specify the correct file system type to the mount command (but I'm presuming you have already done that and it did work). Also, it would be a good idea for you to read the man for the relevant mount command (so, if the fstype is hfs, you'll need to read man mount_hfs; similarly, if it's nfs, you need to man mount_nfs; have a look at the bottom of man mount for more fs specific mount commands).

Hope that helps!