THIS IS DANGEROUS, root access inside a Terminal.

Discussion in 'MacBook Pro' started by wisecracker, Nov 1, 2012.

  1. wisecracker macrumors newbie

    wisecracker

    Joined:
    Sep 24, 2012
    Location:
    In front of my computer.
    #1
    I have no idea if this is common knowledge but here goes.

    Getting root access on a Terminal inside a MacBook Pro OSX 10.7.5 or lower.
    (I have NOT this tested on OSX 10.8.x, MAYBE someone could test...)

    you WILL need your ADMIN USER password, a root password in not required.

    It will look as though nothing is happening when typing your user password
    but carry on ending with a <CR>. <CR> = RETURN/ENTER key.

    Inside the Terminal code I have added <CR> to denote the RETURN/NETER key...
    Code:
    Last login: Thu Nov  1 19:52:20 on console
    Barrys-MacBook-Pro:~ barrywalker$ whoami<CR>
    barrywalker
    Barrys-MacBook-Pro:~ barrywalker$ sudo -s<CR>
    Password:_hidden_user_password_<CR>
    bash-3.2# whoami<CR>
    root
    bash-3.2# cd /<CR>
    bash-3.2# ls<CR>
    .DocumentRevisions-V100	Network			home
    .Spotlight-V100		System			mach_kernel
    .Trashes		User Information	net
    .file			Users			private
    .fseventsd		Volumes			sbin
    .hotfiles.btree		bin			tmp
    .vol			cores			usr
    Applications		dev			var
    Library			etc
    bash-3.2# whoami<CR>
    root
    bash-3.2# exit<CR>
    exit
    Barrys-MacBook-Pro:~ barrywalker$ whoami<CR>
    barrywalker
    Barrys-MacBook-Pro:~ barrywalker$ exit<CR>
    logout
    
    [Process completed]
    
    Bazza, G0LCU...
     
  2. whiteonline macrumors 6502

    whiteonline

    Joined:
    Aug 19, 2011
    Location:
    California, USA
    #2
    That's how sudo works. When you execute a command using sudo, it runs as superuser. In your case you used superuser to invoke a new shell (superuser is of course root).

    Nothing to worry about. Only admin users can execute sudo by default in OS X.

    Read up on sudo and the visudo command if you are worried.
     
  3. Peace macrumors Core

    Peace

    Joined:
    Apr 1, 2005
    Location:
    Space--The ONLY Frontier
    #4
    hehe

    having the admin password IS root access.

    [​IMG]
     
  4. wisecracker thread starter macrumors newbie

    wisecracker

    Joined:
    Sep 24, 2012
    Location:
    In front of my computer.
    #5
    Hi whiteonline...

    I certainly am not worried.

    I am well aware of what sudo does too, (Linux flavours).

    That is why I quoted, "I have no idea if this is common knowledge but
    here goes."

    I see many users asking how to get root access on Macs and just gave the information away in its simplest form for ANYONE to understand based on
    the MacBook Pro, circa August 2012.

    It makes for easy searching in the forums especially when there is a DEMO
    to show exactly how it is done.

    Much like I gave away this info too:-

    http://forums.macrumors.com/showthread.php?t=1453193

    And other freebie stuff on here...

    Bazza, G0LCU...
     
  5. lixuelai macrumors 6502a

    Joined:
    Oct 29, 2008
    #6
    It is hard to imagine anyone who has ever used the terminal not knowing this.
     
  6. whiteonline macrumors 6502

    whiteonline

    Joined:
    Aug 19, 2011
    Location:
    California, USA
    #7
    posting a title of how to obtain root access would be apt. The current title reads of panic.
     
  7. wisecracker, Nov 1, 2012
    Last edited by a moderator: Nov 1, 2012

    wisecracker thread starter macrumors newbie

    wisecracker

    Joined:
    Sep 24, 2012
    Location:
    In front of my computer.
    #8
    Hi whiteonline...

    Point taken...

    Many thanks...
     
  8. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #9
    Generally speaking, newbies and kids probably shouldn't be messing around with Terminal, anyway, unless they know what they're doing.
     
  9. wisecracker, Nov 1, 2012
    Last edited: Nov 2, 2012

    wisecracker thread starter macrumors newbie

    wisecracker

    Joined:
    Sep 24, 2012
    Location:
    In front of my computer.
    #10
    After being ridiculed by the few, I have now been chastised.

    So this is my last post...

    Goodbye...

    Bazza, G0LCU...
     

Share This Page