Auto mounting SMB multiple Mac Users

  1. last week

    Boudewijn K

    Sep 12 Pre-Release Testers, Xojo Pro Amsterdam NL, Fischer Tx

    On a Mac Desktop App, Currently, I execute the shell command from Xojo below to mount a network drive:

    shell.Execute ("mount -t smbfs smb://user:password@Server/path //Volumes/path")

    and on exit I unmount this drive.

    This works well, until the Mac User is switched: then I get a "Permission denied" error.

    I understand that the share is owned by the user that mounts,
    but how would I avoid not getting the server mounted when the Mac user switches?
    I cannot delete the mount path as that would require sudo.

    I know the server could be added to the login items, but I don't want manual end user action to be needed to mount the volume.

    Any ideas anyone?

    You could probably mount it once per user using different destination paths.

  2. Greg O

    Sep 12 Xojo Inc Answer Somewhere near Raleigh, NC

    You could probably mount it once per user using different destination paths.

  3. Boudewijn K

    Sep 12 Pre-Release Testers, Xojo Pro Amsterdam NL, Fischer Tx

    Thanks Greg, While you posted this I was going down that route and it seems to work.
    Now the mount path includes the username, so each is independent.

  4. José M

    Sep 12 Pre-Release Testers, Xojo Pro Spain

    You can specify a group with gid and forcegid parameters when mount, set permissions for this, and in the server set permissions (groups, etc) and configure the share with something like:

    create mask = 0775
    directory mode = 0775
    force create mode = 0775
    force directory mode = 0775
    force group = +group_to_use

or Sign Up to reply!