Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Gentoo Chat
  • Search

How many of you are using doas?sudo?what about root tty1?

Opinions, ideas and thoughts about Gentoo. Anything and everything about Gentoo except support questions.
Post Reply
  • Print view
Advanced search
54 posts
  • 1
  • 2
  • 3
  • Next

Which one is your primary way to access root

doas
9
25%
sudo
19
53%
tty login root
7
19%
root disabled/single-user bootup
1
3%
 
Total votes: 36
Your vote has been cast.

Author
Message
coalms
n00b
n00b
Posts: 27
Joined: Tue Nov 28, 2023 3:06 am

How many of you are using doas?sudo?what about root tty1?

  • Quote

Post by coalms » Mon Dec 04, 2023 7:49 am

Honestly, do you prefer having programs like sudo and doas in your "daily driver"? Or you you just avoid the security escalation vulnerability of having a program such at this and just run tty1 root tmux/screen? If tty then have you though about hardening your keyboard and xorg so programs cannot ctrl+alt+fX on an open root tty xorg emulating a tty to sniff your password?

PS I wourld have made this into a poll but no such option appears so I guess I do not have the permission to do so, if an admin sees this do poll it if possible

Edit: realised I should have posted this on gentoo chat sub-forum where I have both poll rights and thinking about it now imo is a more fitting place to post it, but at this point I made enough posts for today where deleting this and reposting it there wourld give me an error(too many posts), unless this is moved Ill repost tomorrow
  • Moved the topic to "Gentoo Chat" subforum for you.
    You should be able to add poll now.
    • -- Zucca
Thanks Zucca :D
Last edited by coalms on Tue Dec 05, 2023 12:43 am, edited 1 time in total.
Top
spica
Guru
Guru
Posts: 382
Joined: Fri Jun 04, 2021 6:12 pm

  • Quote

Post by spica » Mon Dec 04, 2023 10:02 am

Navigating complex discussions about borderline cases can be likened to a sausage stick:
one end has the exclusive "root user," while the other end lacks any root access.
The reality, much like the savory truth in this metaphor, lies nestled somewhere in the middle.
Top
Zucca
Administrator
Administrator
User avatar
Posts: 4694
Joined: Thu Jun 14, 2007 10:31 pm
Location: Rasi, Finland
Contact:
Contact Zucca
Website

  • Quote

Post by Zucca » Mon Dec 04, 2023 10:31 am

I'm using doas, as I found its construction (code) quite simple. This in hopes that it's less prone to security flaws.
..: Zucca :..

Code: Select all

init=/sbin/openrc-init
-systemd -logind -elogind seatd
I am NaN! I am a man!
Top
lemon426
n00b
n00b
User avatar
Posts: 34
Joined: Wed Nov 29, 2023 8:14 am

  • Quote

Post by lemon426 » Mon Dec 04, 2023 10:54 am

Hello!

For my part, I use sudo more often. But for some time now (well over a month now), I've been using doas. The fact that I can (partly) read the source code and understand it helps a lot. And in terms of optimization (although I'm sure it's not much), doas is really very small in size!
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Mon Dec 04, 2023 11:21 am

coalms'

I use sudo but its usually

Code: Select all

sudo su -
to get root access for a string of commands.

Why?
fortune wrote:It is fruitless to indoctrinate a superannuated canine with innovative maneuvers
and I'm one of those. :)
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Naib
Watchman
Watchman
User avatar
Posts: 6101
Joined: Fri May 21, 2004 9:42 pm
Location: Removed by Neddy
Contact:
Contact Naib
Website

  • Quote

Post by Naib » Mon Dec 04, 2023 11:23 am

I just use su - to get a root shell :(
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Top
rfx
Apprentice
Apprentice
Posts: 176
Joined: Wed Apr 19, 2023 1:23 pm
Location: de-by

  • Quote

Post by rfx » Mon Dec 04, 2023 11:31 am

+1 sudo
Top
NichtDerHans
Apprentice
Apprentice
Posts: 222
Joined: Fri Jan 27, 2023 3:19 pm

  • Quote

Post by NichtDerHans » Mon Dec 04, 2023 11:36 am

Naib wrote:I just use su - to get a root shell :(
+1
Top
pietinger
Administrator
Administrator
Posts: 6629
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Mon Dec 04, 2023 12:09 pm

Naib wrote:I just use su - to get a root shell :(
+1
https://wiki.gentoo.org/wiki/User:Pietinger --> New at Gentoo
Top
Hu
Administrator
Administrator
Posts: 24398
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Mon Dec 04, 2023 1:58 pm

I use a root login on a console for serious maintenance. I use my user in an xterm running /bin/su -l for routine root administration. Also, everything that can be run under setpriv --nnp is, so most of my shells cannot use /bin/su to elevate.
Top
NeglectedRudderPug
n00b
n00b
User avatar
Posts: 41
Joined: Wed Oct 04, 2023 9:02 pm

  • Quote

Post by NeglectedRudderPug » Mon Dec 04, 2023 3:57 pm

Personally, I just use the command:
su -
From the GUI, and log directly in as root on tty where necessary.

I'm of the view sudo has it's place when you're dealing with multiple users on larger systems where you must regulate and control root access. But on a local system with one user, it's just more convenient to use su, so I don't have to write sudo before each root command. (My root and local account passwords are different though. :oops:)
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Mon Dec 04, 2023 4:43 pm

As many others here, I've never seen any need to do anything other than "su -". At one time I'm sure this is essentially all anyone running Linux used until Ubuntu started that whole trend with no root password, where sudo was the only option. Always disliked that whole idea.

Tom
Top
spica
Guru
Guru
Posts: 382
Joined: Fri Jun 04, 2021 6:12 pm

  • Quote

Post by spica » Mon Dec 04, 2023 5:27 pm

Code: Select all

sudo bash
I run sudo bash as the dash key is too distant for my pinky.
Top
grknight
Retired Dev
Retired Dev
Posts: 2565
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Mon Dec 04, 2023 5:35 pm

spica wrote:

Code: Select all

sudo bash
I run sudo bash as the dash key is too distant for my pinky.
This can get you in trouble with environment bleeding in from the user. This can be errors, or at worst, have a bad actor take control if the user is compromised.

It is best to use su - or sudo -i to prevent the environment issues.
Top
Goverp
Advocate
Advocate
User avatar
Posts: 2402
Joined: Wed Mar 07, 2007 6:41 pm

  • Quote

Post by Goverp » Mon Dec 04, 2023 7:51 pm

Naib wrote:I just use su - to get a root shell :(
+1
Greybeard
Top
spica
Guru
Guru
Posts: 382
Joined: Fri Jun 04, 2021 6:12 pm

  • Quote

Post by spica » Mon Dec 04, 2023 8:56 pm

grknight wrote:
spica wrote:

Code: Select all

sudo bash
I run sudo bash as the dash key is too distant for my pinky.
This can get you in trouble with environment bleeding in from the user. This can be errors, or at worst, have a bad actor take control if the user is compromised.

It is best to use su - or sudo -i to prevent the environment issues.
This is a good point, thanks!
Top
CaptainBlood
Advocate
Advocate
User avatar
Posts: 4237
Joined: Sun Jan 24, 2010 9:38 am

  • Quote

Post by CaptainBlood » Mon Dec 04, 2023 9:51 pm

Naib wrote:I just use su - to get a root shell :(
+1
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Top
Zucca
Administrator
Administrator
User avatar
Posts: 4694
Joined: Thu Jun 14, 2007 10:31 pm
Location: Rasi, Finland
Contact:
Contact Zucca
Website

  • Quote

Post by Zucca » Mon Dec 04, 2023 11:06 pm

Looks like I'm in the minority with doas. :o
..: Zucca :..

Code: Select all

init=/sbin/openrc-init
-systemd -logind -elogind seatd
I am NaN! I am a man!
Top
flexibeast
l33t
l33t
Posts: 682
Joined: Mon Apr 04, 2022 4:15 am
Location: Naarm/Melbourne, Australia
Contact:
Contact flexibeast
Website

  • Quote

Post by flexibeast » Mon Dec 04, 2023 11:12 pm

'su -l' for me also, with the '-l' making sure i don't have a hybrid user+root environment that can create various issues. And, yeah, this is probably because i started using Linux long before Ubuntu's "sudo all the things" approach became widespread.

That said, what potential problems are there with using 'sudo' or 'doas' all the time instead of 'su'?
Top
coalms
n00b
n00b
Posts: 27
Joined: Tue Nov 28, 2023 3:06 am

Damn

  • Quote

Post by coalms » Tue Dec 05, 2023 1:20 am

To be honest I am baffled by the results up until this point, the points I have seen just up until now are simple, doas is an unofficial port and while some users see it as a vulnerability not having the right kernel access as the bsd og the compactness of code is
su -,sudo -i or any sudo variation is quite hardened spaghetti code which I would have originally though the gentoo community would stay away from
tty is cumbersome to switch all the time and yet the most secure out of all to administer the system without booting to single-user or init=/bin/bash

personally on a daily driver its tty for me and in case I have to leave my machine emerging while I am away from home i prefix my commands with a comma

Code: Select all

,(){
   eval "$@ && exit || exit"
}

but that is because of my living environment anyhow

nevertheless I was secretly hoping that someone uses an obscure "new" command or something like "root passwd shell /root/mnt/rootusb/bin/bash, auto-mountable encrypted usb, tty12 on /root/mnt/rootusb/dev/tty12 and otherwise disabled unless mounted ,root path points first to /mnt/rootusb/bin, usb unlocks only when the libra sodiac sign aligns with neptune and passes my blood test sample as original and fresh etc etc"
Top
psycho
Guru
Guru
User avatar
Posts: 553
Joined: Fri Jun 22, 2007 1:40 am
Location: New Zealand

  • Quote

Post by psycho » Tue Dec 05, 2023 2:08 am

Depends if we're counting running or just typing them. If I need root access for something unusual I'll type su in a terminal, but I have a few scripts that use sudo to start/stop services or whatever. So on a typical day I'm probably using sudo the most (but I'm not typing it, I'm doing GUI stuff that's using it in the background). Actually typing the instruction though, it's nearly always su.
Top
flexibeast
l33t
l33t
Posts: 682
Joined: Mon Apr 04, 2022 4:15 am
Location: Naarm/Melbourne, Australia
Contact:
Contact flexibeast
Website

  • Quote

Post by flexibeast » Tue Dec 05, 2023 3:05 am

@coalms:

Well, there are instances where i use (open)doas too. Here's a more complete picture:

* As part of starting up my GUI environment on my (Gentoo) laptop, a kitty terminal is opened, containing several tabs. One of those is a 'root' tab, with an 'su -l' session. Normally i'm in other tabs, but for tasks (or more likely, series of tasks) requiring root, i'll switch to the 'root' tab, switching back to other tabs when local root isn't necessary.

* i use opendoas on my laptop, but for specific tasks requiring different privileges (e.g. using Wireshark), not as a generic tool to do whatever i want as root.

* i use doas on my OpenBSD server, e.g. running a PHP admin script as the 'www' user.
Top
Hu
Administrator
Administrator
Posts: 24398
Joined: Tue Mar 06, 2007 5:38 am

Re: Damn

  • Quote

Post by Hu » Tue Dec 05, 2023 3:08 am

I do not recall the state of the code or the configuration language for doas. I recall that the configuration language for sudo is rather unpleasant to work with, and suspect that many sites confer far more sudo privilege than is needed simply because assigning an exactly correct amount is too cumbersome in the grammar.
coalms wrote:personally on a daily driver its tty for me and in case I have to leave my machine emerging while I am away from home i prefix my commands with a comma

Code: Select all

,(){
   eval "$@ && exit || exit"
}
What is the point of this? If you want the shell to go away, just exec "$@". Using eval is usually wrong. Using CMD && exit || exit looks unnecessarily complex. If you do not want to exec, you could use ; exit instead of the && || combination.
Top
coalms
n00b
n00b
Posts: 27
Joined: Tue Nov 28, 2023 3:06 am

Re: Damn

  • Quote

Post by coalms » Tue Dec 05, 2023 5:31 am

Hu wrote:What is the point of this? If you want the shell to go away, just exec "$@". Using eval is usually wrong. Using CMD && exit || exit looks unnecessarily complex. If you do not want to exec, you could use ; exit instead of the && || combination.
That was a mistake I wrote this from memory, here is the correct one

Code: Select all

trap 'exit' INT
eval "$@ && exit || exit " || exit
It is just excessive fail-safes,I do not have the leniency to stand around my portable device when emerging and for work and living environment related reasons/being around mischievous individuals having my device open is a reason to format and go again, I won't ever leave a xorg server open in these cases but rather use a tty, if I am using the device actively ill just "emerge -xyz @world", if however I have to leave the presence of my device I run ", emerge -xyz @world", simply if emerge fails then exit, if emerge succeeds exit, if exit fails. . . exit, worse case scenario if there was a "cancel exit command" vulnerability someone could take advantage of by spamming ctrl+c or ctrl+z it wourld still exit because of trap

edit: as far as I remember i put the last || exit after the quotes to catch ctrl+z actions, thinking about it I could probably trap these as well,eh food for thought
edit2: just checked online, trapping ctrl+z is more like ctrl+Zombies since the script will never die, dunno if it was why i did so with || exit or not
Last edited by coalms on Tue Dec 05, 2023 5:58 am, edited 3 times in total.
Top
coalms
n00b
n00b
Posts: 27
Joined: Tue Nov 28, 2023 3:06 am

Re: Damn

  • Quote

Post by coalms » Tue Dec 05, 2023 5:49 am

Hu wrote:I do not recall the state of the code or the configuration language for doas. I recall that the configuration language for sudo is rather unpleasant to work with, and suspect that many sites confer far more sudo privilege than is needed simply because assigning an exactly correct amount is too cumbersome in the grammar.
iirc doas is cumbersome to configure only on edge cases but very easy to deal with with normal staff, with automation scripts once I wanted to allow non-wheel users to execute a user owned script containing "doas /path/to/non/sticky/bit/root/script" apparently if you want to do so you couldn't use "doas name-of-non-sticky-bit-root-script-without-whole-path-even-if-its-the-first-file-on-path.sh" and you have to allow rights to the user or group to execute that exact path on doas.conf, its very cut and dry since as far as I understood from that interaction it doesn't check the path before executing doas, it just passes $@ to doas as it is and compairs to doas.conf, sudo on the other hand has so many options that I just avoid using it completely, especially when using githab scripts I go by interpreting the intended purpose based on the man page and do it by hand, I am probably the most backwards person in this poll tbh and that is why I started it, wanna see what's up with your interactions, but then again just like you said sites give more sudo privilages than they need to so I tend to be safe
Top
Post Reply
  • Print view

54 posts
  • 1
  • 2
  • 3
  • Next

Return to “Gentoo Chat”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic