Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Can you enable root from the command line?

Can you enable root from the command line?
Thread Tools
Mac Elite
Join Date: Feb 2002
Location: Hilton Head, SC
Status: Offline
Reply With Quote
Mar 22, 2006, 02:31 PM
 
Or do you have to do it only from the gui?
     
Mac Elite
Join Date: Sep 2005
Location: Vancouver, BC
Status: Offline
Reply With Quote
Mar 22, 2006, 03:14 PM
 
Enabling root amounts to just setting a password for the account. Thus ...

[Tom@Poopie]~: passwd root
Changing password for root.
password for Tom: [type your password here]
New password: [type a password for root here]
Retype new password: [repeat above]
     
Mac Elite
Join Date: Feb 2002
Location: Hilton Head, SC
Status: Offline
Reply With Quote
Mar 22, 2006, 05:26 PM
 
Any other way?
     
Mac Elite
Join Date: Sep 2005
Location: Vancouver, BC
Status: Offline
Reply With Quote
Mar 22, 2006, 05:53 PM
 
Nope. If you think of all the ways possible to change a password for an OS X user account, then you've thought of all the ways to enable root.

For the command line, I can really only come up with "passwd". What is it that you need to do, exactly? Maybe I can find another way to do what you want.
     
Mac Elite
Join Date: Jan 2003
Location: 127.0.0.1
Status: Offline
Reply With Quote
Mar 22, 2006, 08:15 PM
 
Why not just use sudo?
     
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Mar 23, 2006, 01:29 PM
 
Originally Posted by alphasubzero949
Why not just use sudo?
Yep, if your current user is an admin, use sudo passwd root. For the record, and anyone reading this after the fact, users in the "admin" group are allowed to issue commands with root's effective user id (id == 0) by typing in THEIR own password.
Code:
[theman@thefro: ~]$ sudo id Password: uid=0(root) gid=0(wheel) groups=0(wheel),1(daemon),2(kmem),3(sys),4(tty),20(staff),29(certusers),5(operator),80(admin)
See?
"In Nomine Patris, Et Fili, Et Spiritus Sancti"

     
Mac Elite
Join Date: Sep 2005
Location: Vancouver, BC
Status: Offline
Reply With Quote
Mar 23, 2006, 03:46 PM
 
"passwd root" > "sudo passwd root" ;-)
     
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Mar 27, 2006, 01:28 AM
 
Originally Posted by Tomchu
"passwd root" > "sudo passwd root" ;-)
A few less characters...
"In Nomine Patris, Et Fili, Et Spiritus Sancti"

     
Forum Regular
Join Date: Feb 2005
Status: Offline
Reply With Quote
Mar 28, 2006, 09:21 PM
 
If you need a root shell use sudo /bin/bash
     
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Apr 6, 2006, 01:40 PM
 
Originally Posted by Tyler McAdams
Any other way?
Yes, there is a command line interface to NetInfo.

But enabling root is entirely unnecessary as there is sudo and su. I have never had a need to enable root.
     
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Apr 6, 2006, 02:04 PM
 
Originally Posted by __^^__
If you need a root shell use sudo /bin/bash
Or sudo -s .
[Wevah setPostCount:[Wevah postCount] + 1];
     
Mac Elite
Join Date: Feb 2002
Location: Hilton Head, SC
Status: Offline
Reply With Quote
Apr 11, 2006, 01:20 PM
 
Originally Posted by Rainy Day
Yes, there is a command line interface to NetInfo.

But enabling root is entirely unnecessary as there is sudo and su. I have never had a need to enable root.
Excellent! That's exaclty what I'm looking for... how do you invoke it?
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 11, 2006, 01:31 PM
 
How do you invoke the command-line interface to Netinfo, you mean? It's niutil. If you're asking about sudo, you just type sudo followed by a command.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Mac Elite
Join Date: Feb 2002
Location: Hilton Head, SC
Status: Offline
Reply With Quote
Apr 11, 2006, 02:33 PM
 
niutill is what I meant. thanks!
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 11, 2006, 04:24 PM
 
There's also the dsenableroot tool.
     
   
Thread Tools
Forum Links
Forum 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 On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:32 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2