Running as root vs. alternatives

Off-topic discussion/chat/argue area with special rules of engagement.
Forum rules
The Off-Topic area is a general community discussion and chat area with special rules of engagement.

Enter, read and post at your own risk. You have been warned!
While our staff will try to guide the herd into sensible directions, this board is a mostly unrestricted zone where almost anything can be discussed, including matters not directly related to the project, technology or similar adjacent topics.

We do, however, require that you:
  • Do not post anything pornographic.
  • Do not post hate speech in the traditional sense of the term.
  • Do not post content that is illegal (including links to protected software, cracks, etc.)
  • Do not post commercial advertisements, SEO links or SPAM posts.
We also ask that you keep strongly polarizing topics like politics and religion to a minimum. This forum is not the right place to discuss such things.
Please do exercise some common sense. How you act here will inevitably influence how you are treated elsewhere.
User avatar
Mike_Walsh
Moonbather
Moonbather
Posts: 65
Joined: 2019-09-14, 20:09
Location: King's Lynn, UK

Running as root vs. alternatives

Unread post by Mike_Walsh » 2025-03-08, 19:59

Moderator note: off-topic split off from the Veit Kannegieser repo topic
Veit Kannegieser wrote:
2025-01-16, 23:46
The change the prevents the "Check for updates, but let me choose whether to install them" was done when protecting against running as root user.
If you want to revert that back, you would need to remove the file /usr/lib/palemoon/updates, after every update. I can not recommend that.
Heh.

I'm only hazarding a guess here, but I think you'd absolutely hate Puppy. We 'run-as-root' ALL THE TIME. Which makes sense, TBH, given that she was always designed to be deployed as a single-user, "hobbyist" distro for 'tinkerers'. Zero percentage in asking the system for permission to use it when you're the sole user.....and with read-only system files in Puppy, she's all but 'bomb-proof' anyway.

Don't get me wrong. 'Sudo' does have its uses......in a large organisation, with lots of different users, it absolutely makes sense. For us, though, it's kinda pointless.

No different to the early days, really, before multi-user became a thing. We all ran as root.....and you learned to be 'careful'.

(*shrug...*)

Mike. ;)
Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

Lucio Chiappetti
Keeps coming back
Keeps coming back
Posts: 755
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: Veit Kannegieser's repo

Unread post by Lucio Chiappetti » 2025-03-08, 20:55

Not so sure about the early days, at least for me.
Early days were the '90s and we were running various Unixes (from SunOS to Tru64) at work. With NIS. Most machines were for a single user, but we had the normal unprivileged user, and root. Power users knew the root password and did su - to log in as root (the other asked the sysman).
We continued that under openSuse and now (x)ubuntu.
I see that the ubuntu purists (or puritans :D ) for home users advocate for no login as root, but one of the first things I do on my home machines is to allow login as root. I do use sudo and have even a custom /etc/sudoers for particular commands, but it's another story.
Concerning Pale Moon (specially for personal use) I do not see any reason to load it from a deb repo, since there are tar files. I have Pale Moon installed under my username (but for a softlink from /usr/bin), and the internal updater works more than nicely.
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37352
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Veit Kannegieser's repo

Unread post by Moonchild » 2025-03-09, 09:57

Lucio Chiappetti wrote:
2025-03-08, 20:55
I see that the ubuntu purists (or puritans :D ) for home users advocate for no login as root, but one of the first things I do on my home machines is to allow login as root. I do use sudo and have even a custom /etc/sudoers for particular commands, but it's another story.
From a strictly security point of view, it can also be argued that sudo is actually more dangerous than using root explicitly; it shifts the system's highest security protection to every sudoer with their normal credentials, basically multiplying the attack points to every sudoer on the system, not just a single root account. And does so through various scattered mechanisms to boot: group membership, a plaintext config file that can be accessed through e.g. a compromised process, etc. making it not only a broader attack surface but also potentially harder to detect unless you explicitly monitor not only root access but also account elevation events.
"The world will not be destroyed by those who do evil, but by those who watch them without doing anything." - Albert Einstein
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
andyprough
Board Warrior
Board Warrior
Posts: 1060
Joined: 2020-05-31, 04:33

Re: Veit Kannegieser's repo

Unread post by andyprough » 2025-03-10, 15:26

Moonchild wrote:
2025-03-09, 09:57
From a strictly security point of view, it can also be argued that sudo is actually more dangerous than using root explicitly; it shifts the system's highest security protection to every sudoer with their normal credentials, basically multiplying the attack points to every sudoer on the system, not just a single root account. And does so through various scattered mechanisms to boot: group membership, a plaintext config file that can be accessed through e.g. a compromised process, etc. making it not only a broader attack surface but also potentially harder to detect unless you explicitly monitor not only root access but also account elevation events.
Which is why doas exists. Anyone concerned about sudo security can simply purge it from their system and setup doas, which I believe is borrowed from openbsd. Or, you can keep using sudo for use by system services, but keep the user accounts limited to doas. I'm pretty sure those options exist. I've used systems with sudo, with sudo and doas, and with just doas.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37352
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Veit Kannegieser's repo

Unread post by Moonchild » 2025-03-10, 15:58

andyprough wrote:
2025-03-10, 15:26
Which is why doas exists. Anyone concerned about sudo security can simply purge it from their system and setup doas
doas is just a more minimalist and more user-friendly alternative to sudo, though...
The two benefits doas has over sudo are that it’s smaller in size, the configuration file is empty, and its syntax is smaller and easier to remember, requiring almost no effort to audit.
i.e. it's advantage is that it's smaller and less complex to configure/use (sudoers can get a bit thick in its syntax), but the main function and mechanics remain the same...
It doesn't change the fact that a regular user doesn't seem to need special credentials to run a command as root though, which is my main concern with sudo. Any user with elevation privileges can run things as root with their own credentials; so if that end-user account gets compromised, the compromised credentials also grant access to root without any further barriers.
That's why I'm apprehensive about it and make the argument it can really be worse than root logins when specifically needed.
"The world will not be destroyed by those who do evil, but by those who watch them without doing anything." - Albert Einstein
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
andyprough
Board Warrior
Board Warrior
Posts: 1060
Joined: 2020-05-31, 04:33

Re: Veit Kannegieser's repo

Unread post by andyprough » 2025-03-10, 16:28

Moonchild wrote:
2025-03-10, 15:58
It doesn't change the fact that a regular user doesn't seem to need special credentials to run a command as root though, which is my main concern with sudo. Any user with elevation privileges can run things as root with their own credentials; so if that end-user account gets compromised, the compromised credentials also grant access to root without any further barriers.
That's why I'm apprehensive about it and make the argument it can really be worse than root logins when specifically needed.
But can't you just set up a different required password in sudo/doas for running commands as root? I thought that was part of the configuration. Admittedly, I have not delved deeply into the subject, and sudo has lots of configuration options. But I believe you can set it up to be about as secure as you like. Sounds like your concern is about the way that distros like Ubuntu set up sudo by default.

And you do need special credentials - you need to be in the sudoers file. If your system has an administrator, they are likely to be very picky about who gets sudo root privileges, and what groups your user can belong to and so forth.

I'm sure none of this is news to you though. The deeper you dig into any operating system, the more layers of security configuration options you'll find. I'm sure that Windows can be configured for far greater security than what it presents by default to the average "Home" user.

Lucio Chiappetti
Keeps coming back
Keeps coming back
Posts: 755
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: Running as root vs. alternatives

Unread post by Lucio Chiappetti » 2025-03-10, 16:54

Mah ... as an user of my own machines at home, of my "personal" machine at work, and of other machines at work (of all of which I have also the root password, though rarely I may use it), the thing for which sudo is convenient for the user is to define some commands as NOPASSWD, and to alias some invocations of "sudo command options...".
E.g. mounting and umounting NFS disks, starting and stopping a VPN, manipulating iptables, calling the distro manager (yast or synaptic).
Even giving access to some commands to a CGI script (using a nologin user).
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37352
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Running as root vs. alternatives

Unread post by Moonchild » 2025-03-10, 19:17

andyprough wrote:
2025-03-10, 16:28
But I believe you can set it up to be about as secure as you like. Sounds like your concern is about the way that distros like Ubuntu set up sudo by default.
That's the problem though: those defaults are what everyone and their uncle uses. I'm not specialist in sudo or what it's full array of options are, or how secure it can possibly be made with additional passwords or what not, I was just highlighting the fact that, in general, it's probably less secure than people might think because in its default use, the credentials asked for will be the end-user's password and not something else, making the system's security much more easily compromised.
Lucio Chiappetti wrote:
2025-03-10, 16:54
Mah ... as an user of my own machines at home, of my "personal" machine at work, and of other machines at work (of all of which I have also the root password, though rarely I may use it), the thing for which sudo is convenient for the user is to define some commands as NOPASSWD, and to alias some invocations of "sudo command options...".
Of course context is key :) Just highlighting an issue I see with it in less secure context/more volatile environments.
"The world will not be destroyed by those who do evil, but by those who watch them without doing anything." - Albert Einstein
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
andyprough
Board Warrior
Board Warrior
Posts: 1060
Joined: 2020-05-31, 04:33

Re: Running as root vs. alternatives

Unread post by andyprough » 2025-03-10, 19:28

Moonchild wrote:
2025-03-10, 19:17
That's the problem though: those defaults are what everyone and their uncle uses. I'm not specialist in sudo or what it's full array of options are, or how secure it can possibly be made with additional passwords or what not, I was just highlighting the fact that, in general, it's probably less secure than people might think because in its default use, the credentials asked for will be the end-user's password and not something else, making the system's security much more easily compromised.
Fair enough. But it's similar to performance. Pretty much every OS/distro is restricting performance by default to give a better and more stable experience for the nontechnical user. But you can sure go in and tweak the hell out of it in most cases, just like you can overclock chips in a lot of cases. Just depends on what you want and how deep you want to dive.

User avatar
Basilisk-Dev
Lunatic
Lunatic
Posts: 478
Joined: 2022-03-23, 16:41
Location: Chamber of Secrets

Re: Running as root vs. alternatives

Unread post by Basilisk-Dev » 2025-03-20, 13:38

Huh. My username on Linux and Unix systems has always been root. I never ran into any permissions issues. Am I doing something wrong?

Also relevant: https://www.garyshood.com/root/
Basilisk Project Owner

viewtopic.php?f=61&p=230756

User avatar
andyprough
Board Warrior
Board Warrior
Posts: 1060
Joined: 2020-05-31, 04:33

Re: Running as root vs. alternatives

Unread post by andyprough » 2025-03-21, 14:50

Basilisk-Dev wrote:
2025-03-20, 13:38
Huh. My username on Linux and Unix systems has always been root. I never ran into any permissions issues. Am I doing something wrong?

Also relevant: https://www.garyshood.com/root/
You're not really cool until your name in real life is Root. Neal Stephenson's character 'Enoch Root' across several of his novels spanning numerous centuries makes for an interesting view of some of the potential implications.