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 > macOS > Can you enable root from the command line?

Can you enable root from the command line?
Thread Tools
Tyre MacAdmin
Mac Elite
Join Date: Feb 2002
Status: Offline
Reply With Quote
Mar 22, 2006, 04:31 PM
 
Or do you have to do it only from the gui?
     
Tomchu
Mac Elite
Join Date: Sep 2005
Status: Offline
Reply With Quote
Mar 22, 2006, 05: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]
     
Tyre MacAdmin  (op)
Mac Elite
Join Date: Feb 2002
Status: Offline
Reply With Quote
Mar 22, 2006, 07:26 PM
 
Any other way?
     
Tomchu
Mac Elite
Join Date: Sep 2005
Status: Offline
Reply With Quote
Mar 22, 2006, 07: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.
     
alphasubzero949
Mac Elite
Join Date: Jan 2003
Location: 127.0.0.1
Status: Offline
Reply With Quote
Mar 22, 2006, 10:15 PM
 
Why not just use sudo?
     
[APi]TheMan
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Mar 23, 2006, 03: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"

     
Tomchu
Mac Elite
Join Date: Sep 2005
Status: Offline
Reply With Quote
Mar 23, 2006, 05:46 PM
 
"passwd root" > "sudo passwd root" ;-)
     
[APi]TheMan
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Mar 27, 2006, 03: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, 11:21 PM
 
If you need a root shell use sudo /bin/bash
     
Rainy Day
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Apr 6, 2006, 02: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.
     
Wevah
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Apr 6, 2006, 03:04 PM
 
Originally Posted by __^^__
If you need a root shell use sudo /bin/bash
Or sudo -s .
[Wevah setPostCount:[Wevah postCount] + 1];
     
Tyre MacAdmin  (op)
Mac Elite
Join Date: Feb 2002
Status: Offline
Reply With Quote
Apr 11, 2006, 02: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?
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 11, 2006, 02: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'."
     
Tyre MacAdmin  (op)
Mac Elite
Join Date: Feb 2002
Status: Offline
Reply With Quote
Apr 11, 2006, 03:33 PM
 
niutill is what I meant. thanks!
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 11, 2006, 05:24 PM
 
There's also the dsenableroot tool.
     
   
 
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
Top
Privacy Policy
All times are GMT -4. The time now is 11:42 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,