Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.7: Mount AFP volume with root bug Network
I'm sick of waiting for Apple to come up with a fix to trying to mount a volume in 10.7 while logged in as root so I came up with my own solution.
cat >/tmp/mountVolume.sh <<-"EOF"
osascript -e 'mount volume "afp://username:password@server/path/"'
EOF
chmod 755 /tmp/mountVolume.sh
su -l guest /tmp/mountVolume.sh
rm -f /tmp/mountVolume.sh
When run as root this will use the guest account to mount the volume -- it's a work around and only recommended for those whom understand the root account.

[crarko adds: I haven't tested this one.]
    •    
  • Currently 3.00 / 5
  You rated: 1 / 5 (12 votes cast)
 
[5,132 views]  

10.7: Mount AFP volume with root bug | 13 comments | Create New Account
Click here to return to the '10.7: Mount AFP volume with root bug' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.7: Mount AFP volume with root bug
Authored by: dfbills on Jan 09, '12 07:48:09AM

Some more context on this would be helpful.

---
-d



[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: Frederico on Jan 09, '12 08:15:56AM

Great tip; thanks. Only run into this a couple times so far, and I was just using FUS to get it mounted and get the job done.

Now it's time to queue up the inevitable 'you don't need root, no, really, you never, ever need root and are foolish to use it under any circumstances and you deserve to have your computers stolen as a result. ' punditry by people who just don't get the power or proper circumstances of root. (;



[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: leamanc on Jan 09, '12 08:58:28AM

I haven't found a need to login as root to the GUI since at least 10.2.x, maybe even 10.1.x, back when there were some installers that didn't elevate authentication privileges properly (or at all).

So, I'm game...really, what need do you ever have to log in as root in the GUI? Seems that everything out there that needs root privileges knows how to let you authenticate to it via an admin account. But I would be interested in hearing any scenarios where it's necessary, and by necessary I don't mean "it's easier, and I don't have to put in my password all the time." I have no desire to go back to the Classic Mac OS days where every user had full unmitigated power to drop the System Suitcase (equivalent of the OS X kernel) into the Trash. Yeah, it allowed for some nice hacks, but hacks are not what I want in 2012. :-)



[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: diamondsw on Jan 09, '12 09:47:28AM
Actually, you're going to get that advice from people who perfectly understand the power and circumstances of root, which evidently you don't. If you're logging into the GUI as root and stuff doesn't work, that should be a huge warning sign that you're doing it wrong.

[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: hellomrzebra415 on Jan 09, '12 10:15:19AM

There are VALID reasons why someone would want to log in a root via the gui. I myself have one and also gripe that i have to mount a share via the command line while I am logged into root. And by the way I DO KNOW WHAT I AM DOING. Rather then tell people they are doing something wrong, you may want to find out why they are doing what they are doing and maybe provide a work around. There is always more then one way to do a task.



[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: arcticmac on Jan 09, '12 10:53:58AM

It's true, people will tend to suggest that doing a full login as root is probably doing it wrong. I'm generally inclined to agree, but before I pass judgement, I _would_ love to hear what it is that you're using it for? Similar to one previous poster, I haven't done a GUI root login since 10.2. That's not to say that I don't use sudo quite a lot, and once in a while even 'sudo bash' (that's usually when I'm needing to do rooted things on someone else's machine and don't want to have to ask for their password 35 times).

So, what is it that you're doing?

Also, re the original post, wouldn't it be a whole lot easier to just (haven't tried this)

sudo -u guest osascript -e 'mount volume "afp://username:password@server/path/"'

[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: leamanc on Jan 09, '12 11:43:25AM

I don't want to be nitpicky, but why create the script and run it and then delete it everytime? Why not just create a script that's permanent somewhere?

Why specifically chmod 755 when a simple chmod +x would suffice?

Why mount the volume via an AppleScript wrapped up in osascript when Apple provides mount_afp?

And all that before we even to start questioning the need to login as root. :-)



[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: marksch on Jan 10, '12 10:19:40AM

Probably because for most people chmod 755 is easier than chmod +x. It is an automatism. Sometimes I write 755 when I mean 666 ;-)

---
Mark

Economy-x-Talk
Have your own custom software created
http://economy-x-talk.com



[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: hellomrzebra415 on Jan 10, '12 09:59:47AM

I log in as root to compile images for Jamfs Casper Suite. If you do not login as root you have to enter password each time a new package is called up to be installed. If you log in as root you do not. This way I can start the compile and walk away. Also sometimes it can take hours to compile an image with a lot of packages and needs to run over night, am I going to login in from home and put in the password each time an app is run, I do not think so. This is why I log in as root, Also the net boot image that is used to image a mac, needs to be logged in as root for the imaging process to work correctly.



[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: arcticmac on Jan 10, '12 12:20:51PM

Hm... I'm not familiar with that one, but it seems like you might have some luck running the Jamfs software as root on a non-root login. Just open a terminal window and do something like

sudo /Applications/JamfsThingy.app/Contents/MacOS/JamfsThingy

(where you'd obviously put in the right class to the admin app). Should solve the problem of prompting for a password every time. The second one sounds more complicated.



[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: applebit on Jan 10, '12 06:38:07PM

I think the reason most people are scared of root is the same situation as a person being scared of guns. Guns don't kill people, people kill people.

---
Jon McCullough
Systems Support Specialist



[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: arcticmac on Jan 10, '12 10:17:02PM

Not logging in as root is arguably easier:
1) I don't have to enable the root account
2) I don't have to close my current session, I just run whatever I need using sudo within my current session
3) I don't have to deal with weird bugs like this, because the rest of my current session is still there, so I can mount the afp server normally and access the mount from the software running with elevated privileges.



[ Reply to This | # ]
10.7: Mount AFP volume with root bug
Authored by: neuralstatic on Jan 13, '12 01:55:23PM

*facepalm*



[ Reply to This | # ]