SUDO Memory not remebered

Hi
Greetings here I am new but not new to Linux. I have on my test bench EndeavourOS.
I am used to having the use of SUDO remembered : for instance if one is using,

sudo pacman -S clementine

as soon as its finished one can install the next application,

pacman -S celluloid

And it works, the use off sudo is remembered. However I find that here in this OS that
that one must use sudo every time … A minor gripe but is there a way to tune memory for SUDO.

I realize this could be a security risk, but its what Iam used to.

Alternatively, you can use yay to install Arch packages like this. yay doesn’t need sudo

yay -S clementine
yay -S celluloid

yay has less characters than pacman too :wink:

1 Like

For applications which call sudo from within them, it will remember your password and not repeat it.

However, in this case:

There is nothing that would automatically apply the sudo to pacman and it doesn’t try to escalate on it’s own.

As @sradjoker points out, you could use a wrapper like yay or paru which do escalate from within instead of calling pacman directly.

2 Likes

That would be a bad idea that would completely defeat the purpose of sudo, which is to specify exactly which command should be run with root privileges. If every subsequent command was then run with sudo, that would be the same thing as using su. I don’t think any distro does that, so I do not understand how you can be used to this.

What is remembered with multiple uses of sudo is the fact you’ve verified with your user password. So if you run two commands with sudo within some time interval, you only need to input the password the first time.

You can use su if you really want an interactive shell session as root. If you want to enter your user password instead of your root password, you can run sudo su.

But you shouldn’t. Especially if you’re using yay, you should always be running it without root privileges, so it can build the AUR packages without privileges.

As a general rule on Linux, you should not be using root privileges to do something that can be done without root privileges.

4 Likes