×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles
    in:

    How to gain root access to Mac OSX: Difference between revisions

    Content added Content deleted
    imported>Phrack
    (New page: ===Mac OSX: get root access or reset root password=== *find out your username if you are an unprivileged user by opening Finder:Applications:Terminal: your username is the string right be...)
     
    imported>mutante
    mNo edit summary
     
    (One intermediate revision by the same user not shown)
    Line 1: Line 1:
    ===Mac OSX: get root access or reset root password===
    ===[[Mac]] [[OS X]]: get root access or reset root password===


    *find out your username if you are an unprivileged user by opening Finder:Applications:Terminal: your username is the string right before the $-symbol
    *find out your username if you are an unprivileged user by opening Finder:Applications:Terminal: your username is the string right before the $-symbol
    Line 5: Line 5:
    *push the power-button and immediately press cmd(the apple-key)+s to enter single-user-mode
    *push the power-button and immediately press cmd(the apple-key)+s to enter single-user-mode
    *mount the root-filesystem in r/w mode by typing: "mount -uw /"
    *mount the root-filesystem in r/w mode by typing: "mount -uw /"
    *type "visudo"
    *type "visudo" (--> [[vi]])
    *go to the lines starting with root and %admin and press "dd" on both of them
    *go to the lines starting with root and %admin and press "dd" on both of them
    *press i to enter insert mode and add the following lines:
    *press i to enter insert mode and add the following lines:
    **root ALL=(ALL) NOPASSWD: ALL
    **<tt>root ALL=(ALL) NOPASSWD: ALL</tt>
    ** %admin ALL=(ALL) NOPASSWD: ALL
    **<tt>%admin ALL=(ALL) NOPASSWD: ALL</tt>
    ** YOURusernameYOUfoundOUT ALL=(ALL) NOPASSWD: ALL
    **<tt>YOURusernameYOUfoundOUT ALL=(ALL) NOPASSWD: ALL</tt>
    ***(where you need to put a TAB-character between e.g. root and the first ALL - and a TAB-character between (ALL) and NOPASSWD: - and a space-character between NOPASSWD: and ALL
    ***(where you need to put a TAB-character between e.g. root and the first ALL - and between (ALL) and NOPASSWD: - and a space-character between NOPASSWD: and ALL
    *press escape to exit input mode and enter the ":" character by pressing shift and ; on an english keyboard or shift and . on a german keyboard to enter command mode
    *press escape to exit input mode and enter the ":" character by pressing shift and ; on an english keyboard or shift and . on a german keyboard to enter command mode
    *enter "x" and press enter to save and close
    *enter "x" and press enter to save and close
    *enter reboot to reboot the machine
    *enter reboot to reboot the machine
    *once you're back in standard OSX open the terminal application again (Finder:Applications:Terminal) and enter:
    *once you're back in standard OSX open the terminal application again (Finder:Applications:Terminal) and enter:
    **sudo passwd YOURusernameYOUfoundOUT
    **[[sudo]] passwd YOURusernameYOUfoundOUT
    ***enter your new password, press enter and enter it again to confirm it
    ***enter your new password, press enter and enter it again to confirm it
    **sudo passwd root
    **sudo passwd root
    Line 22: Line 22:
    *now, if you like, you can open "System Preferences", go to "Accounts" and click the lock-symbol at the bottom left of the System Preferences dialog, authenticate with username: root and your new password and give YOURusernameYOUfoundOUT admin privileges by checking the "allow user to administer this computer" checkbox
    *now, if you like, you can open "System Preferences", go to "Accounts" and click the lock-symbol at the bottom left of the System Preferences dialog, authenticate with username: root and your new password and give YOURusernameYOUfoundOUT admin privileges by checking the "allow user to administer this computer" checkbox
    ===you now have admin privileges with your user and the ability to add new users to the system, change all settings, install software etc.===
    ===you now have admin privileges with your user and the ability to add new users to the system, change all settings, install software etc.===

    [[Category:Mac]]

    Latest revision as of 15:43, 20 October 2007

    Mac OS X: get root access or reset root password[edit]

    • find out your username if you are an unprivileged user by opening Finder:Applications:Terminal: your username is the string right before the $-symbol
    • shutdown your mac
    • push the power-button and immediately press cmd(the apple-key)+s to enter single-user-mode
    • mount the root-filesystem in r/w mode by typing: "mount -uw /"
    • type "visudo" (--> vi)
    • go to the lines starting with root and %admin and press "dd" on both of them
    • press i to enter insert mode and add the following lines:
      • root ALL=(ALL) NOPASSWD: ALL
      • %admin ALL=(ALL) NOPASSWD: ALL
      • YOURusernameYOUfoundOUT ALL=(ALL) NOPASSWD: ALL
        • (where you need to put a TAB-character between e.g. root and the first ALL - and between (ALL) and NOPASSWD: - and a space-character between NOPASSWD: and ALL
    • press escape to exit input mode and enter the ":" character by pressing shift and ; on an english keyboard or shift and . on a german keyboard to enter command mode
    • enter "x" and press enter to save and close
    • enter reboot to reboot the machine
    • once you're back in standard OSX open the terminal application again (Finder:Applications:Terminal) and enter:
      • sudo passwd YOURusernameYOUfoundOUT
        • enter your new password, press enter and enter it again to confirm it
      • sudo passwd root
        • enter the same new password again, press enter and confirm it
    • now, if you like, you can open "System Preferences", go to "Accounts" and click the lock-symbol at the bottom left of the System Preferences dialog, authenticate with username: root and your new password and give YOURusernameYOUfoundOUT admin privileges by checking the "allow user to administer this computer" checkbox

    you now have admin privileges with your user and the ability to add new users to the system, change all settings, install software etc.[edit]

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.