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
[crarko adds: I haven't tested this one.]
|
|
|
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 [crarko adds: I haven't tested this one.]
•
[5,172 views]
Hint Options
10.7: Mount AFP volume with root bug
Some more context on this would be helpful. ---
-d
10.7: Mount AFP volume with root bug
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.
10.7: Mount AFP volume with root bug
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).
10.7: Mount AFP volume with root bug
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.
10.7: Mount AFP volume with root bug
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.
10.7: Mount AFP volume with root bug
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/"'
10.7: Mount AFP volume with root bug
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 Why mount the volume via an AppleScript wrapped up in And all that before we even to start questioning the need to login as root. :-)
10.7: Mount AFP volume with root bug
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
10.7: Mount AFP volume with root bug
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.
10.7: Mount AFP volume with root bug
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.
10.7: Mount AFP volume with root bug
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
10.7: Mount AFP volume with root bug
Not logging in as root is arguably easier:
10.7: Mount AFP volume with root bug
*facepalm* |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.12 seconds |
|