Unable to mount AFP shares

SMC
New Contributor

Hello,

I've downloaded the mountNetworkShare.sh and set it up as a login policy for users but it doesn't seem to be mounting the share so I checked the logs and it seems to run without failing, this is the log message:

***

Executing Policy Map MacShares...
Running script mountNetworkShare.sh...
Script exit code: 0
Script result: Volume name will be created as Students... Removing Empty Directory: /Volumes/Stuents... Attempting to mount afp dsc-macsrv/Students using test2008's kerberos ticket... - 206 com.jamfsoftware.mapdrive.Students Unloading com.jamfsoftware.mapdrive.Students... Loading com.jamfsoftware.mapdrive.Students...

***

These are the variables I've set

# HARDCODED VALUES SET HERE
shareUsername="$3" authType="kerberos" password="" mountType="afp" share='afp://dsc-macsrv/Students'

I am currently using Casper 9.12 and my mac labs are running OSX 10.8.5

Has anyone come across this issue and found a solution to it?

Any help would be greatly appreciated

17 REPLIES 17

calum_carey
Contributor

is kerberos working correctly?

SMC
New Contributor

I believe so. I can manually mount that share once I am logged on as the user

bentoms
Release Candidate Programs Tester

@SMC if you run the script manually as a student, does it work then?

franton
Valued Contributor III

To be honest, I never had much joy with that script. I gave up and massively rewrote it to something far simpler. (It works in our environment due to how we segregate the departments out).

https://github.com/franton/Mount-Network-Share

SMC
New Contributor

@franton I ran your script but noticed that it failed upon logon so I tried to run it manually logged in as a student and got the following message:

"<username> is not in the sudoers file. This incident will be reported"

I also tried to run it without the sudo -u and got:

"Mounting to /Volumes/Students 1...
There was an error mounting the file server . Will attempt again.
Mounting to /Volumes/Students 1...
There was an error mounting the file server . Giving up."

franton
Valued Contributor III

That's because you have spaces in your share name. You'll probably have to "quote" those out.

bentoms
Release Candidate Programs Tester

This is where I usually start to flog my AppleScript alternative: http://macmule.com/2011/09/08/how-to-map-drives-printers-based-on-ad-group-membership-on-osx/

SMC
New Contributor

There's definitely no spaces in my server or share name:

sudo -u test2008 /usr/sbin/jamf mount -server "dsc-macsrv.smc.local" -share "Students" -type "afp"

franton
Valued Contributor III

You got issues. The script is meant to be run from your Casper management account (root level) but taking the current logged in user from Casper and running the mount command as that.

It gets round having to run the jamf command as root but needing the volume mount for a specific user. I'd check to see if your computer has your management account present and it has admin rights.

bentoms
Release Candidate Programs Tester

Is there already a share called "Students" mounted?

pblake
Contributor III

I found in 10.7 and above using a configuration profile was better for share mounts than the script.

SMC
New Contributor

@franton - All casper managed devices have an admin account which they get managed by and I even tried to sudo run it with that account but got the same error.

@bentoms I haven't already mounted that 'Students' share yet but it does work when I manually mount it

@pblake I'm unable to user config profiles yet due to network restrictions so that why I'm trying to find another way of mapping these shares

bentoms
Release Candidate Programs Tester

SMC, I was wondering as it seemed to be mounting "Students 1."

SMC
New Contributor

@bentoms It tried to create 'Students 1' because there was an existing 'Students' folder in /Volumes so I deleted it.
I have the /Volumes location opened so when I ran that mount command I could see for a brief second the 'Students' folder get created but then disappears.

SMC
New Contributor

@bentoms on that link you posted it says :To create the LaunchAgent, copy the below. Replace APPLICATIONNAME with the name of your AppleScript application & save as com.APPLICATIONNAME.plist in /Library/LaunchAgents/ with 755 permissions. NOTE: Replace [ with .

Shouldn't [] be replaced with <> instead?

bentoms
Release Candidate Programs Tester

Correct. It'd just the rubbish way wordpress handles code.

bentoms
Release Candidate Programs Tester

Correct. It's just the rubbish way wordpress handles code.