I have already seen [SOLVED] Why sudo asks for user password in tmux/ssh session? · GitHub Gist, and it looks like this is there by design, but I thought I'd ask anyways:
Say I use a command like this:
tmux new-session -d 'sudo udevadm monitor -e' \; attach
As soon as
tmux starts the new session, it asks for the
sudo password, as expected. But then I try to "cheat" by attempting to validate
$ sudo --validate [sudo] password for user: $ tmux new-session -d 'sudo udevadm monitor -e' \; attach
... and this asks again for a
sudo password as soon as
tmux starts the session - even if I already entered the password successfully beforehand.
So is there a way to start a
tmux session with (a) sudo'ed process(es) inside, with only one sudo password validation beforehand?