Author Topic: Admin, SU and root accounts - need understanding  (Read 3117 times)

Offline atjurhs

  • Super Poster
  • ***
  • Posts: 100
    • View Profile
Admin, SU and root accounts - need understanding
« on: October 18, 2006, 09:41:30 PM »
Hello guys,

Can someone explain to me the difference between admin, su, and root accounts?

I have an admin account type, and it is a single user 10.4 machine (mine and only mine) but I can't seem to login as root or execute line commands begining with su.  I think I know the su and root passwords, and I think they are the same, but differernt than my account login password.  Does any of this make sense?

Offline krissel

  • Administrator
  • TS Addict
  • *****
  • Posts: 14736
    • View Profile
Admin, SU and root accounts - need understanding
« Reply #1 on: October 19, 2006, 01:01:57 AM »
As I understand, the su (super user) is the same as root. Root is used for tasks that affect the system and need special persmission to do so. Admin is able to do almost anything else including acting as root. Kind of like being Clark Kent and going into the phone booth to become Superman for a while. He still has most of Superman's powers while being Clark but can't really use them until he crosses the threshold into his other persona.

You need to go to Netinfo Manager in the Utilities to enable root there first before you do anything in Terminal. Once in Netinfo you need to go to Security in the menu and Authenticate with your admin password. Then go back to Security and Enable Root User will be accessible. Then enter a password for it, log out and when you log back in, choose "other" and enter "root" as name and the password you entered in Netinfo.

Once done with your tasks you should log out and back in as your regular account.

superman.gif


A Techsurvivors founder

Offline kps

  • TS Addict
  • *****
  • Posts: 1693
    • View Profile
    • http://
Admin, SU and root accounts - need understanding
« Reply #2 on: October 19, 2006, 07:32:44 AM »
su and sudo are not the same.

su = substitute user
sudo = superuser do --Root access is granted temporarly to do a specific function.

sudo should work without enabling root with any admin pswd....

To login as root, root needs to be enabled first, as Kris mentioned above. Then you can login as root through the GUI.

You can also enable root from the shell by issuing the following command:

sudo passwd root

enter a pswd you want to use. Saves you the whole NetInfo routine.

Using su in the shell:

you can become root to perform multiple functions (instead of one) by issuing the command:

su root

followed by root's pswd

you could become any user:

su username

followed by the user's pswd

Helps troubleshoot accounts without having to log out and login as the other user, but it only works in the shell and you can't troubleshoot the GUI.

What specifically is it you're trying to do and what isn't working.

You may need to reset passwords using the install disk if there's corruption, but save that for later.
« Last Edit: October 19, 2006, 07:47:04 AM by kps »

Offline giantmike

  • TS Addict
  • *****
  • Posts: 1117
    • View Profile
    • http://www.giantmike.com
Admin, SU and root accounts - need understanding
« Reply #3 on: October 19, 2006, 07:56:31 AM »
QUOTE
Using su in the shell:

you can become root to perform multiple functions (instead of one) by issuing the command:


Note that you can also do multiple sudo commands without re-entering your password each time. After the first entry of the password via sudo, you have about 5 minutes of time granted to you where you can perform multiple commands (each with sudo before them) with root access.
« Last Edit: October 19, 2006, 02:44:20 PM by airbusdriver »

Offline kps

  • TS Addict
  • *****
  • Posts: 1693
    • View Profile
    • http://
Admin, SU and root accounts - need understanding
« Reply #4 on: October 19, 2006, 08:06:39 AM »
True. Poor choice of words on my part, just trying to make the distinction. But as root, you don't need to use sudo each time to begin your commands.
« Last Edit: October 19, 2006, 08:08:33 AM by kps »

Offline krissel

  • Administrator
  • TS Addict
  • *****
  • Posts: 14736
    • View Profile
Admin, SU and root accounts - need understanding
« Reply #5 on: October 20, 2006, 03:41:32 AM »
Oh, I'm so glad the really knowledgeable people showed up. Putting me in the Terminal is like letting a 3 year old drive a car.

rolleyes.gif


A Techsurvivors founder

Offline kps

  • TS Addict
  • *****
  • Posts: 1693
    • View Profile
    • http://
Admin, SU and root accounts - need understanding
« Reply #6 on: October 20, 2006, 07:15:01 AM »
QUOTE(krissel @ Oct 20 2006, 04:41 AM) <{POST_SNAPBACK}>
Putting me in the Terminal is like letting a 3 year old drive a car.


I don't believe that for a second.... smile.gif

Offline atjurhs

  • Super Poster
  • ***
  • Posts: 100
    • View Profile
Admin, SU and root accounts - need understanding
« Reply #7 on: October 22, 2006, 12:43:01 AM »
Ok guys, now I've got another question:

I now have two different passwords, one for root (which has been enabled) and one sudo.  

sudo appears to behave the same as admin, correct?

2nd question: in trying to set all this stuff right, I've somehow creatted another user account that I now need to delete, it's an empty account but it does exist.  How do I delete that goofed upaccount?

Offline cdub1988

  • TS Addict
  • *****
  • Posts: 1186
    • View Profile
    • http://
Admin, SU and root accounts - need understanding
« Reply #8 on: October 22, 2006, 12:50:58 AM »
atjuhrs,

I guess I'm first of all having troubles figuring out why you want to enable root.

It's disabled for pretty good reason, and sudo should be able to handle most all of what you're wanting to do......

I know on OS X and Ubuntu, root is disabled by default (and with good thought behind it).....so that users don't go running around logged in as root and leaving a system open to issues.

Is there something that you're wanting to do that you can't handle using sudo?

Also, as far as deleting the account you're not wanting....did you create it using the accounts applet in System Prefs, or what method did you use to create it?

If you can see the account name listed in Accounts in Sys Prefs, then click on it's name and then click the - sign.

Hope that helps.

Chris
Umm, I'm a nerd.

Offline atjurhs

  • Super Poster
  • ***
  • Posts: 100
    • View Profile
Admin, SU and root accounts - need understanding
« Reply #9 on: October 22, 2006, 09:59:00 AM »
Hi Chris,

Well I guess I'm also having trouble knowing why I should have root enabled on my OSX machine???  

Perhaps it's because I used to have irix and linux boxes and did all sorts of "admin stuff" as root.  If I can do all the admin stuff I ever need to do on OSX with just sudo, then I guess I don't need to have root enabled.

So, how to I un-enable root?

BTW, I was able to remove the empty account with the GUI, thanks!


QUOTE(cdub1988 @ Oct 22 2006, 05:50 AM) <{POST_SNAPBACK}>
atjuhrs,

I guess I'm first of all having troubles figuring out why you want to enable root.

It's disabled for pretty good reason, and sudo should be able to handle most all of what you're wanting to do......

I know on OS X and Ubuntu, root is disabled by default (and with good thought behind it).....so that users don't go running around logged in as root and leaving a system open to issues.

Is there something that you're wanting to do that you can't handle using sudo?

Also, as far as deleting the account you're not wanting....did you create it using the accounts applet in System Prefs, or what method did you use to create it?

If you can see the account name listed in Accounts in Sys Prefs, then click on it's name and then click the - sign.

Hope that helps.

Chris

Offline Xairbusdriver

  • Administrator
  • TS Addict
  • *****
  • Posts: 26388
  • 27" iMac (mid-17), Big Sur, Mac mini, Catalina
    • View Profile
    • Mid-South Weather
Admin, SU and root accounts - need understanding
« Reply #10 on: October 23, 2006, 09:55:26 PM »
Actually, an extremely large majority of us seem to get most stuff done without even opening Terminal, much less enabling root. That's kinda the whole point of OS X. It's designed to make a lot of stuff possible without actually needing the CLI. I'd say the vast majority of Mac users don't even know how to access the menu to enable root and would have no idea of what to do with Terminal.

However, I don't consider "Admin" the same as "sudo". I thought that was the reason to still have "sudo". I would consider "sudo" and "root" as equals, however. But I probably need to go back and read the definitions again...blush-anim-cl.gif
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system
CAUTION! Childhood vaccinations cause adults! :yes: