0

I'm a noob with OSX (10.8.5) wanting to install homebrew on an Airbook.

Installing homebrew fails straight away because it can't mkdir /usr/local. So I try with sudo - same problem. Trying sudo mkdir /usr/local directly also fails of course.

My user 'mjb' has admin rights (well according to the Users/Groups GUI interface) but I can't figure out how to do anything useful !

As my 'admin' user mjb, typing id shows "uid=502(mjb) gid=20(staff) ...." typing sudo id shows "uid=503(root) gid=1000 ...."

I've searched and all the solutions I see involve editing some file (root.plist) directly or using visudo ... and of course I don't have the permissions to do that !

I just want "real" sudo access so I can install stuff on the command-line (boot2docker).

Thanks for any suggestions

Update:

dscl . ls /Users provides a lot of output:

_amavisd
_appleevents
_appowner
_appserver
_ard
_assetcache
_atsserver
_avbdeviced
_calendar
_ces
_clamav
_coreaudiod
_cvmsroot
_cvs
_cyrus
_devdocs
_devicemgr
_dovecot
_dovenull
_dpaudio
_eppc
_ftp
_geod
_installassistant
_installer
_jabber
_kadmin_admin
_kadmin_changepw
_krb_anonymous
_krb_changepw
_krb_kadmin
_krb_kerberos
_krb_krbtgt
_krbtgt
_lda
_locationd
_lp
_mailman
_mcxalr
_mdnsresponder
_mysql
_netbios
_netstatistics
_networkd
_postfix
_postgres
_qtss
_sandbox
_screensaver
_scsd
_securityagent
_serialnumberd
_softwareupdate
_spotlight
_sshd
_svn
_taskgated
_teamsserver
_timezone
_tokend
_trustevaluationagent
_unknown
_update_sharing
_usbmuxd
_uucp
_warmd
_webauthserver
_windowserver
_www
daemon
mjb
nobody
Paulina
root

dscl . read /Users/root

AppleMetaNodeLocation: /Local/Default
GeneratedUID: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000
NFSHomeDirectory: /Local/Users/root
Password: *
PasswordPolicyOptions: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "apple.com/DTDs/PropertyList-1.0.dtd">; 
<plist version="1.0">
<dict>
    <key>failedLoginCount</key>
    <integer>0</integer>
    <key>failedLoginTimestamp</key>
    <date>2001-01-01T00:00:00Z</date>
    <key>lastLoginTimestamp</key>
    <date>2001-01-01T00:00:00Z</date>
    <key>passwordLastSetTime</key> 
    <date>2015-06-09T18:48:49Z</date>
</dict>
</plist>
PrimaryGroupID: 1000
RealName:
 Mike Bright
RecordName:
 root
 BUILTIN\Local System
RecordType: dsRecTypeStandard:Users 
SMBSID: S-1-5-18 
UniqueID: 503 
UserShell: /bin/bash
5
  • 1
    Enabling and using the "root" user in OS X this bing search might also be helpful.
    – Ramhound
    Jun 10, 2015 at 18:44
  • possible duplicate of How do I enable the root account in Mac OS X?
    – Ramhound
    Jun 10, 2015 at 18:46
  • @Ramhound Not a dup. The fact that he can't do root-like things just by sudo'ing from an admin account makes it clear that something else is screwed up. The fact that the "root" account apparently shows as UID 503 instead of 0 is even more evidence.
    – Spiff
    Jun 10, 2015 at 19:11
  • What sort of error message do you recieve (if any) when you try sudo mkdir /usr/local?
    – lzam
    Jun 11, 2015 at 2:42
  • sudo mkdir /usr/local Password: mkdir: /usr/local: Permission denied
    – mjbright
    Jun 11, 2015 at 19:37

1 Answer 1

1

The real superuser root account is always Always ALWAYS UID 0. How you got an account named "root" on your system with UID 503 is beyond me.

You may need to manually fix up your Directory Services data store (your users and groups database) with Directory Utility or dscl.

open /System/Library/CoreServices/Directory\ Utility.app

I think that was the path back in 10.8.5, but it's been a long time. Nowadays it's…

open /System/Library/CoreServices/Applications/Directory\ Utility.app

That app has a Directory Editor you should be able to use to see what's going on with the inner details of the accounts on your machine.

Alternatively, seeing the output of the following two commands would help me see what's going on:

dscl . ls /Users
dscl . read /Users/root
10
  • Thanks.for your suggestions. Running that first Open command (that is the correct path) gives me the error (whether I use sudo or not): LSOpenURLsWithRole() failed with error -10810 for the file /System/Library/CoreServices/Directory Utility.app.
    – mjbright
    Jun 11, 2015 at 19:40
  • dscl . ls /Users provides a lot of output: _amavisd _appleevents _appowner _appserver _ard _assetcache _atsserver _avbdeviced _calendar _ces _clamav _coreaudiod _cvmsroot _cvs _cyrus _devdocs _devicemgr _dovecot _dovenull _dpaudio _eppc _ftp _geod _installassistant _installer _jabber _kadmin_admin _kadmin_changepw _krb_anonymous _krb_changepw _krb_kadmin _krb_kerberos _krb_krbtgt _krbtgt _lda _locationd _lp _mailman _mcxalr _mdnsresponder _mysql _netbios _netstatistics _networkd _postfix _postgres _qtss _sandbox _screensaver
    – mjbright
    Jun 11, 2015 at 19:41
  • dscl . ls /Users output continued .... _scsd _securityagent _serialnumberd _softwareupdate _spotlight _sshd _svn _taskgated _teamsserver _timezone _tokend _trustevaluationagent _unknown _update_sharing _usbmuxd _uucp _warmd _webauthserver _windowserver _www daemon mjb nobody Paulina root
    – mjbright
    Jun 11, 2015 at 19:42
  • $ dscl . read /Users/root AppleMetaNodeLocation: /Local/Default GeneratedUID: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000 NFSHomeDirectory: /Local/Users/root Password: * PasswordPolicyOptions: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "apple.com/DTDs/PropertyList-1.0.dtd">
    – mjbright
    Jun 11, 2015 at 19:44
  • <plist version="1.0"> <dict> <key>failedLoginCount</key> <integer>0</integer> <key>failedLoginTimestamp</key> <date>2001-01-01T00:00:00Z</date> <key>lastLoginTimestamp</key> <date>2001-01-01T00:00:00Z</date> <key>passwordLastSetTime</key> <date>2015-06-09T18:48:49Z</date> </dict> </plist> PrimaryGroupID: 1000 RealName: Mike Bright RecordName: root BUILTIN\Local System RecordType: dsRecTypeStandard:Users SMBSID: S-1-5-18 UniqueID: 503 UserShell: /bin/bash
    – mjbright
    Jun 11, 2015 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.