From the sudoers man page:
SUDOERS OPTIONS
tty_tickets
If set, users must authenticate on a per-tty basis. With this flag enabled, sudo will use a separate record in the time stamp file for each tty. If disabled, a single record is used for all login sessions. This flag is on by default.
In other words, disabling tty_tickets
creates a single ticket that is shared across every tty for that user. Authenticating on any tty creates a new ticket which becomes valid on every other tty belonging to that user, voila - no redundant password prompt just because you opened a new tab.
I recommend setting defaults on a per-user basis, along the lines of:
echo Defaults:$USER '!tty_tickets' | sudo tee -a /etc/sudoers.d/mycustomconf
If you really want to, I suppose, you could make a change to the global defaults in /etc/sudoers with visudo
. Something like this placed with the other defaults near the top should do:
Defaults !tty_tickets
Since the next question is usually "how can I change the session timeout value?", I figured I'd include it here for the sake of convenience:
## disable per-tty auth, timeout after 15 minutes
echo Defaults:$USER '!tty_tickets', timestamp_timeout=15 | sudo tee -a /etc/sudoers.d/mycustomconf
sudo
setup so that after you have run asudo
command, you can another fewsudo
commands without entering your password? – Wilf Jul 08 '14 at 04:46pkexec
and notsudo
that you are using. – muru Jul 08 '14 at 04:49gksudo
(or something similar), it would maintain a session (or a timeout), during which you didn't have to enter password again, just likesudo
. AFAIK,pkexec
does not support such a timeout, or session. So the program used for authentication matters in this context. – muru Jul 08 '14 at 05:09