0

Obviously it's widely recommended not to log in directly as a superuser account, but I'm curious.

What is the flag or setting that FreeBSD uses to recognise those accounts that automatically gain su privilege on login, without the user executing any login script or extra privilege-escalation command?

1
  • 1
    O.o su logs in as uid 0 unless you tell it otherwise, and you're asking why logging in as uid 0 logs in as uid 0 without having to use su?
    – muru
    Nov 8, 2019 at 11:07

1 Answer 1

3

The “setting” is that root and toor have user id 0, which is what determines that it’s the superuser.

This is alluded to by the title of this FreeBSD FAQ entry, “What is this UID 0 toor account? Have I been compromised?”

3
  • 1
    As simple as that. Thanks! So all su accounts are really just aliases of the same account? But with possibly different other settings?
    – Stilez
    Nov 8, 2019 at 11:12
  • 1
    Yes, the other entries in /etc/passwd and related files can be different, so you can have multiple superuser accounts with different passwords (which is the original point of toor), different shells (common in the past with statically-linked shells), different home directories... Nov 8, 2019 at 11:14
  • You can also assign users to the wheel group. Which gives them nearly the same power. Using groups often makes security an easier, less complicated task.
    – somebody
    Mar 4, 2020 at 23:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .