Root Permission

Posted:
in Genius Bar edited January 2014
Why do i not have root permission? i am the only user on the machine. I am trying to install apache and when i do the make install it can not create /usr/local/apache2 tells me that i do not have permission. I tried su root and my password but that did not work. Also what is the equivilent of the DOS dir command? dir works in RHEP, SuSe, etc just not on OS/X



Thanks,



-AG

Comments

  • Reply 1 of 6
    kickahakickaha Posts: 8,760member
    cd = dir



    You may want to grab a Unix tutorial before getting too deep into this.



    As for the root access, MacOS X has *two* levels of 'superuser' access... root, and admin. You're an admin by default when you're the only user. Don't use 'su root', use 'sudo'. 'man sudo' will give you the scoop. It essentially says "I'm doing an action that I'm allowed to do as admin" without having to swap over completely over to a root login.



    They did this to eliminate the 'all or nothing' approach of the usual Unix installation. Admins are a step in between, and have 99% of the power of root without being able to do *REALLY* stupid things without explicitly going through the convolutions of setting up root, then su'ing into it. It's an excellent compromise.
  • Reply 2 of 6
    agallantagallant Posts: 87member
    So would i do:

    sudo username make install

    ?
  • Reply 3 of 6
    agallantagallant Posts: 87member
    Never mind sudo make install worked. Thanks





    -AG
  • Reply 4 of 6
    kickahakickaha Posts: 8,760member
    Yeah, it skips the logging in as the other person.



    Downside: you have to 'sudo' in front of every command.



    Upside: you can't forget you're logged in as root and do something stupid.



    Once you authenticate, you can sudo all you want for 5 minutes without having to give another password.
  • Reply 5 of 6
    dobbydobby Posts: 797member
    Open NetinfoManager (under Apps/utils).

    Click on Security - Enable root user and enter a password.



    You can now su to root.



    Or you can just delete the password entry in netinfo.



    If you are really paranoid about cocking something up then tar up your /var/db/netinfo/local.nib dir. You can then boot -s and restore your netinfo db.



    Dobby.
  • Reply 6 of 6
    kickahakickaha Posts: 8,760member
    Of course, you've just made it easier for a script kiddie to hack in by giving them a known tasty target called 'root'... :P



    I've never needed to turn on the root account. Ever. I don't see that it adds anything useful to working as an admin other than you not needing to prepend 'sudo ' to root-access-required commands. Whoo. Furthermore, it prevents you from forgetting you're root and doing something silly with a typo. I've done it on other systems. It's not pretty.



    It's everyone's choice, of course, if enabling root gets your rocks off, go for it. But there really isn't much of an upside, and a very significant potential downside.
Sign In or Register to comment.