Running an app in Terminal logged in as Root - ehMac.ca
Facebook
Twitter
YouTube
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
Old Apr 26th, 2006, 09:49 AM   #1
Full Citizen
 
Join Date: Feb 2005
Location: Toronto
Posts: 218
Running an app in Terminal logged in as Root

I've recently acquired an app which will only run in Terminal and only if logged in as root.

I'm confident this app is legit. I've never created a Root account on this Mac. Do I need to do so, and if so, what's the procedure? Can I switch to root status just within the terminal?

Morley
__________________
Morley Chalmers
Morley is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old Apr 26th, 2006, 10:18 AM   #2
Frequently Befuddled
 
Stephanie's Avatar
 
Join Date: Jul 2004
Location: Brampton
Posts: 831
Is the app a Unix program or an actual Mac OS X program?

If it's an OS X program, what you can do is go into the terminal, cd to the directory where this app is located then type "sudo open [appname]" without the quote marks, and [appname] is the name of the application including the .app suffix.

The comptuer will then ask you for your password. Then it will attempt to run the app.

If it's a Unix program then go to the directory where the program is located and type this instead "sudo ./[appname]" without the quotemarks. Again, the computer will ask for your password then will attempt to run the app.

In both cases the 'sudo' tells the computer you want to do the following action as if you were root. It asks for your password (not the root password) as means of confirmation. Note that this only works if your account is set up as an Admin on your computer. You cannot 'sudo' if you are not an administrative user.

Also note that 'sudo' can be a very dangerous command and any apps that require to be run as root can do tremendous damage to your system if they are malicious. For instance, with 'sudo', a simple 7-character Unix command can erase your entire hard drive. So it should be used with caution.

-Stephanie
__________________
She who laughs last -- probably made a back-up.
Stephanie is offline   Reply With Quote
Old Apr 26th, 2006, 11:33 AM   #3
Full Citizen
 
Join Date: Jun 2004
Location: Hamilton, ON and Montreal, QC
Posts: 195
Quote:
Originally Posted by Stephanie
In both cases the 'sudo' tells the computer you want to do the following action as if you were root. It asks for your password (not the root password) as means of confirmation. Note that this only works if your account is set up as an Admin on your computer. You cannot 'sudo' if you are not an administrative user.
That's generally true.

But it is possible to allow non-admin users to sudo. I personally don't like using the Admin account as my normal account, so what I do is this:

1) login as Admin
2) edit the /etc/sudoers file. Add my normal account name to it.
3) logout.
4) login to my normal account

Now I can sudo from my normal account.
ernestworthing is offline   Reply With Quote
Old Apr 26th, 2006, 01:21 PM   #4
Public Servant
 
Chealion's Avatar
 
Join Date: Jan 2001
Location: Calgary
Posts: 7,069
Send a message via ICQ to Chealion Send a message via AIM to Chealion Send a message via MSN to Chealion
If you absolutely have to enable the root account:

http://docs.info.apple.com/article.html?artnum=106290

I'd recommend not as sudo should get you to do anything you need to, as in root any changes don't have any barriers at all, while with sudo it requires your password to be entered (and remembers that you're sudo'd for 5 minutes), giving you one more chance to confirm the command you're doing.
__________________
I still remember Macnutt.
Chealion is offline   Reply With Quote
Old Apr 26th, 2006, 03:50 PM   #5
Full Citizen
 
Join Date: Dec 2005
Location: londonon
Posts: 376
Just a bit of clarification, 'sudo open' won't launch the app as "root" - I think it did in 10.0 but they changed that at some point so that 'open' always launches the app as the user logged in to the GUI.

For application packages, call the executable directly, ie.:
Code:
sudo /path/to/App.app/Contents/MacOS/App
For certain non-package apps, use:
Code:
sudo /System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp /path/to/App.app
biovizier is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Mystery of the crashing trash bash... drehleierguy Mac, iPhone, iPad and iPod Help & Troubleshooting 11 May 16th, 2005 11:35 AM
Need OSX system file gordguide Mac, iPhone, iPad and iPod Help & Troubleshooting 8 Feb 20th, 2005 05:00 PM
The latest Mac virus Sandy McMurray Anything Mac 27 May 27th, 2003 09:54 AM
help in running Terminal commands csonni Mac, iPhone, iPad and iPod Help & Troubleshooting 6 Feb 18th, 2003 10:59 PM
More Routing Q?: Jaguar Network Setting Q? Ohenri Anything Mac 11 Dec 22nd, 2002 04:30 AM


All times are GMT -4. The time now is 02:09 PM.



Copyright © 1999 - 2012, ehMac.ca All rights reserved. ehMac is not affiliated with Apple Inc. Mac, iPod, iTunes, iPhone, Apple TV are trademarks of Apple Inc. Content Relevant URLs by vBSEO 3.6.0 RC 2

Tribe.ca: Urban living in Toronto!