You are not logged in.
Pages: 1
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
What does "persist sudo" mean?
Offline
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
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
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
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
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
If you need to run multiple commands with sudo you should probably just switch to root with `sudo -s` or `su root`.
Offline
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.
Offline
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.
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
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
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:
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks!
Sudo persistance doesn't exist, I may have confused it with elevating permissions for a specific directory/user permanently with chown. [SOLVED]
Offline
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.
Offline
Pages: 1