image
image

|


Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old July 11th, 2006, 05:07 PM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
McMendo is on a distinguished road
root?

I can't get root on a MacBook Pro that I bought recently. I created a new user on the computer when I started it the first time. I thought that I had created the new user with full privileges, or near.

On an xterm, I can't execute some commands because I don't have the privileges. Not even 'sudo'. I looked at the /etc/passwd file, but there is no root user there.

What's the trick?
Reply With Quote
  #2  
Old July 11th, 2006, 05:16 PM
nixgeek's Avatar
Mac of the SubGenius! :-)
 
Join Date: Jan 2004
Location: Miami, FL
Posts: 7,420
Thanks: 12
Thanked 83 Times in 67 Posts
nixgeek will become famous soon enough
Root is disabled in MAc OS X as a security measure. When you created the first user, did you make sure that you gave it the ability to administer the computer?

If you need to become root without becoming root, do a "sudo -s" and then supply your user password. You'll get dropped to a "#" prompt.

Ubuntu Linux also follows this measure similarly.
__________________
Apple iMac G5 17" (2 GHz G5) - Mac OS X 10.4.11
Apple Macintosh Quadra 650 (33 MHz MC68040) - Mac OS 8.1
Apple PowerBook Duo 230 (33 MHz MC68030) - System 7.1
"JHVH-1" (2 GHz AMD Athlon XP 2400+) - Slackware 12.1
"Kidbuntu" (2.8 GHz Celeron D 335) - Ubuntu 8.04
Reply With Quote
  #3  
Old July 11th, 2006, 06:24 PM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
McMendo is on a distinguished road
Fortunately I did give the user admin permissions when I created it. 'sudo -s' worked, thank you.
Reply With Quote
  #4  
Old July 11th, 2006, 06:49 PM
nixgeek's Avatar
Mac of the SubGenius! :-)
 
Join Date: Jan 2004
Location: Miami, FL
Posts: 7,420
Thanks: 12
Thanked 83 Times in 67 Posts
nixgeek will become famous soon enough
Awesome. Glad I could help.
__________________
Apple iMac G5 17" (2 GHz G5) - Mac OS X 10.4.11
Apple Macintosh Quadra 650 (33 MHz MC68040) - Mac OS 8.1
Apple PowerBook Duo 230 (33 MHz MC68030) - System 7.1
"JHVH-1" (2 GHz AMD Athlon XP 2400+) - Slackware 12.1
"Kidbuntu" (2.8 GHz Celeron D 335) - Ubuntu 8.04
Reply With Quote
  #5  
Old July 11th, 2006, 10:11 PM
Mac Metal Head
 
Join Date: Nov 2003
Posts: 821
Thanks: 0
Thanked 0 Times in 0 Posts
HateEternal is on a distinguished road
You know, after all of these years using OS X and linux I never knew of the -s option... that makes my life so much easier hahaha...
Reply With Quote
  #6  
Old July 11th, 2006, 10:40 PM
nixgeek's Avatar
Mac of the SubGenius! :-)
 
Join Date: Jan 2004
Location: Miami, FL
Posts: 7,420
Thanks: 12
Thanked 83 Times in 67 Posts
nixgeek will become famous soon enough


ANother one I found out for Linux was the "su -" command (note the sole dash after the "su"). This logs you as root as if you had logged on from the login prompt. Very useful especially when installing CMS software or MySQL database information.
__________________
Apple iMac G5 17" (2 GHz G5) - Mac OS X 10.4.11
Apple Macintosh Quadra 650 (33 MHz MC68040) - Mac OS 8.1
Apple PowerBook Duo 230 (33 MHz MC68030) - System 7.1
"JHVH-1" (2 GHz AMD Athlon XP 2400+) - Slackware 12.1
"Kidbuntu" (2.8 GHz Celeron D 335) - Ubuntu 8.04
Reply With Quote
  #7  
Old July 12th, 2006, 04:55 AM
fryke's Avatar
Super Moderator
 
Join Date: Sep 2000
Location: macosx.com
Posts: 13,043
Thanks: 2
Thanked 0 Times in 0 Posts
fryke has a spectacular aura aboutfryke has a spectacular aura about
And that's not the same as "sudo -s"? I thought they had the very same result. Or are things you do logged under your username when you're obviously "root" by going to the root shell with "sudo -s"?
__________________
MacBook Air 13" 1.6 GHz, 2 GB RAM, 80 GB HD. Mac OS X 10.5.4
MacBook 13" 1.83 GHz, 2 GB RAM, 160 GB HD. Mac OS X 10.5.4
Hackintosh Core2Duo 2.4 GHz, 2 GB RAM, 160 GB HD. Mac OS X 10.5.4
iPhone 3G 16 GB (v2), AppleTV 1G 40 GB (v2)

Mac user since 1987, Apple Product Professional 2007, 2008.
Reply With Quote
  #8  
Old July 12th, 2006, 06:38 AM
billbaloney's Avatar
House pianist
 
Join Date: Oct 2000
Location: Brooklyn, NY
Posts: 509
Thanks: 0
Thanked 0 Times in 0 Posts
billbaloney is on a distinguished road
sudo -s keeps your original user environment. You can see this, for instance, if you have very different path settings for root and your user. If this is the case, then

sudo -s
echo $PATH

will show a different value than

sudo -s
su -
echo $PATH

Similarly, if you need to switch to a different user and inherit that user's environment, you say

su - [username]
__________________
Matt (billbaloney)
1.67GHz "October 2005" G4 Aluminum 1.5 GB RAM, OS 10.5.2
Lots of other things around
Helen Marie
Holford Industries
Reply With Quote
Reply

Thread Tools

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I log in as ROOT? bighairydog Mac OS X System & Mac Software 2 November 4th, 2001 09:54 AM
Can't log in as root! kvarnbrink Mac OS X System & Mac Software 0 June 5th, 2001 06:43 PM
on root and gcc Char Aznable Mac OS X System & Mac Software 0 May 31st, 2001 11:20 AM
#root skaneby Mac OS X System & Mac Software 3 May 17th, 2001 03:41 AM
Root can't receive email; /var/mail/root Adam Mac OS X System & Mac Software 1 April 9th, 2001 12:23 PM


All times are GMT -5. The time now is 02:31 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.