Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mount SMB Share as root

Hi All,


I'm currently working on migrating some machines from Snow Leopard to Lion, and I have a bunch of postimaging scripts that are fired on first boot. The first script automatically mounts an SMB share to copy the rest of the postimaging scripts and run them. However it would seem that it is no longer possible to mount an SMB share as root (root as in running sudo -i as an admin account to get to a root shell, or running the command prefixed with sudo) as it fails with "mount_smbfs: server rejected the connection: Authentication error". As far as I can tell, the request is not actually making it to the SMB server, as there is no log entries indicating a failure for this particular user to logon.

Is this a known issue, and is there a workaround? I can run the same command as an admin user, but that is not the point, and please don't suggest that I don't use root as was done here.


TIA

Mac mini, Mac OS X (10.7.3)

Posted on Feb 18, 2012 8:19 PM

Reply
1 reply

Feb 18, 2012 9:09 PM in response to gavin0001

Found a workaround over at DeployStudio... http://www.deploystudio.com/Forums/viewtopic.php?id=3018

Basically in the script that's running as root, prefix the mount command with sudo -u <adminuser> ... So for me, because I have an admin account name Administrator, I'd use the following:


sudo -u Administrator mkdir /Volumes/sharename

sudo -u Administrator mount -t smbfs //username:password@server/sharename /Volumes/sharename

<do stuff>


root is still able to umount the mountpoint, so no need to prefix that command.


I'm still interested to know why this behaviour occurs. It definately appears to be an os issue, as I cannot see any log entries indicating failure from the lion machine on the server I'm attempting to connect to. Might give Apple Support a call and post back if I get anywhere...

Mount SMB Share as root

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.