You are not logged in.

#1 2023-09-23 12:50:51

joaomendonca
Member
From: Portugal
Registered: 2023-09-20
Posts: 18

Alacritty doesn't persist sudo

Edit: This topic is [SOLVED], there's ways to make it happen but they are not what I initially thought to be a "feature". Feel free to keep the discussion on by showing alternate/new solutions.

Is there anyway to make Alacritty persist sudo? If not, can you recomend me one or multiple terminals to use on arch + gnome?
(I like simplicity with as much funcionality and customization as possible at the same time, with sane defaults if possible)

I've tried to search for it on the alacritty yaml but there isn't any config related to the matter, also made a quick search on google but only found about "cosign" which seems to make sudo disappear altogether by signing the application with my user account permissions (I want to be forced to use sudo when needed, but keep the session persisted whenever I do use sudo.)

Last edited by joaomendonca (2023-09-23 17:17:37)

Offline

#2 2023-09-23 12:51:56

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,727

Re: Alacritty doesn't persist sudo

What does "persist sudo" mean?

Offline

#3 2023-09-23 14:06:52

joaomendonca
Member
From: Portugal
Registered: 2023-09-20
Posts: 18

Re: Alacritty doesn't persist sudo

Thanks for the quick response!

By persisting sudo I meant the following behavior: You open the terminal app, you use a command that needs sudo permissions, you run the command with sudo command and from that point forward, all commands that need sudo will work without sudo. Now that I think of it, maybe this is a feature from ohmyzsh that I used on the past (now I'm trying startlight)

Offline

#4 2023-09-23 14:45:53

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,727

Re: Alacritty doesn't persist sudo

joaomendonca wrote:

all commands that need sudo will work without sudo.

Full stop. That cannot work, the shell has no way of knowing what commands need to be run with sudo.

Offline

#5 2023-09-23 15:21:51

joaomendonca
Member
From: Portugal
Registered: 2023-09-20
Posts: 18

Re: Alacritty doesn't persist sudo

I used WSL with a debian based distro for 3 years, and I had that behavior on my terminal. (without knowing how, that's why I refered ohmyzsh above, but I def had it)

Offline

#6 2023-09-23 15:31:17

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,727

Re: Alacritty doesn't persist sudo

The only way is if you just ran everything as root. Run the shell with sudo so you never needed to use sudo again because you were already root. Otherwise what you're saying just isn't possible.

Maybe it's a communication issue. Can you provide a concrete, step by step, example of what you're talking about?

Offline

#7 2023-09-23 15:36:27

joaomendonca
Member
From: Portugal
Registered: 2023-09-20
Posts: 18

Re: Alacritty doesn't persist sudo

Surething! Let's imagine the following chain of commands and stdouts:

-> apt-get install htop
<- no permissions to run this command

-> sudo apt-get install htop
<- added 1 package

-> mount /dev/sda /mnt
<- mounted to /mnt # notice how this command needed sudo but didn't request me to do so, it persisted my elevated permissions from the previous command (this also stays for the entire rest of the session till I close my terminal instance)

Does this clarify what I meant by "persisting sudo"?

Last edited by joaomendonca (2023-09-23 15:36:49)

Offline

#8 2023-09-23 16:19:45

illegalcoding
Member
Registered: 2023-09-23
Posts: 7

Re: Alacritty doesn't persist sudo

If you need to run multiple commands with sudo you should probably just switch to root with `sudo -s` or `su root`.

Offline

#9 2023-09-23 16:24:56

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,098

Re: Alacritty doesn't persist sudo

mount doesn't necessarily require elevated privileges if there's a matching entry in the fstab.
It might also have been suid' or whatnot but what you suggest in #7 is not only not possible but flat out batshit crazy and an insanely massive security risk.

Online

#10 2023-09-23 16:27:56

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: Alacritty doesn't persist sudo

I highly doubt what you described in post 7 really happened that way.  There is a fairly common setting such that subsequent uses of sudo (within a given timeout period) would not require you to enter your password.  So you could run the mount command without a password, but it'd still have to be typed out as `sudo mount ...`.

The only way to have what you described in post 7 happen would be if the shell config included some error handler that responded to permission denied errors by silently invoking sudo for you behind the scenes.  This is a horrifically bad idea for oh so many reasons ... which makes it actually quite likely to be something that OMZ does.

In any case, this has nothing to do with the terminal emulator.  It's just the sudo and shell configs.

But really, don't use OMZ.  And don't try to replicate the behavior of post 7.

seth wrote:

flat out batshit crazy and an insanely massive security risk.

Isn't that the tagline for OMZ?

SIDE NOTE: are we just not going to talk about the "apt-get" ... is this an arch system or debian?

Last edited by Trilby (2023-09-23 16:31:06)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#11 2023-09-23 16:37:01

joaomendonca
Member
From: Portugal
Registered: 2023-09-20
Posts: 18

Re: Alacritty doesn't persist sudo

Alright guys, I'm not finding anything about it on the internet so maybe I'm confusing owning the cwd (chown) with having sudo persistance in between commands.

Thank you all for the quick responses, does anyone have any good list of recommendations you'd like to share for terminals so I can mark this topic as solved?

Offline

#12 2023-09-23 16:51:03

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: Alacritty doesn't persist sudo

Ah, what?  You just want a list of terminal emulators so you can mark the thread as solved?  Ok... that's pretty random.  But here you go:

https://wiki.archlinux.org/title/List_o … _emulators


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#13 2023-09-23 16:57:06

joaomendonca
Member
From: Portugal
Registered: 2023-09-20
Posts: 18

Re: Alacritty doesn't persist sudo

Thanks!

Sudo persistance doesn't exist, I may have confused it with elevating permissions for a specific directory/user permanently with chown. [SOLVED]

Offline

#14 2023-09-23 17:07:59

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,098

Re: Alacritty doesn't persist sudo

Mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

fwwy, chowning any path won't allow you to mount random devices there.

Online

Board footer

Powered by FluxBB