Small delay in sudo Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionESC key causes a small delay in terminal due to its Alt+ behaviorsudo vs “rwx” accessStaggering the authentication delay on failed `su` or `sudo`Passwordless sudo not workingsudo not preserving PS1What is the meaning of sudo sudo?“sudo su -” vs “sudo su” commandWhat is a good balance between strong sudo password and a long delayWhy can I run `sudo bash` but not `sudo su`?Update Zsh prompt with sudo timeout information
How to rotate it perfectly?
Unable to start mainnet node docker container
How to say 'striped' in Latin
Single author papers against my advisor's will?
How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time
Stars Make Stars
Can a monk deflect thrown melee weapons?
Array/tabular for long multiplication
I'm having difficulty getting my players to do stuff in a sandbox campaign
The following signatures were invalid: EXPKEYSIG 1397BC53640DB551
What's the difference between (size_t)-1 and ~0?
What did Darwin mean by 'squib' here?
Keep going mode for require-package
Working around an AWS network ACL rule limit
Can I throw a longsword at someone?
How does modal jazz use chord progressions?
Why does tar appear to skip file contents when output file is /dev/null?
Was credit for the black hole image misattributed?
Can a zero nonce be safely used with AES-GCM if the key is random and never used again?
What is the electric potential inside a point charge?
Geometric mean and geometric standard deviation
Estimated State payment too big --> money back; + 2018 Tax Reform
Statistical model of ligand substitution
Why use gamma over alpha radiation?
Small delay in sudo
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionESC key causes a small delay in terminal due to its Alt+ behaviorsudo vs “rwx” accessStaggering the authentication delay on failed `su` or `sudo`Passwordless sudo not workingsudo not preserving PS1What is the meaning of sudo sudo?“sudo su -” vs “sudo su” commandWhat is a good balance between strong sudo password and a long delayWhy can I run `sudo bash` but not `sudo su`?Update Zsh prompt with sudo timeout information
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I want my zsh prompt to display whether the session has sudo rights (from a previously run sudo
command). After looking at the answers to this question, I arranged to use the exit status of sudo -n true
to determine whether the sudo timestamp is still valid.
This works as intended, however the command takes ca. 15 ms to complete. Actually all sudo
commands seem to have this overhead. This is not much, but I notice it and it bothers me. Given that this is not a computationally expensive operation, is there is a faster way to check this?
sudo zsh performance real-time
add a comment |
I want my zsh prompt to display whether the session has sudo rights (from a previously run sudo
command). After looking at the answers to this question, I arranged to use the exit status of sudo -n true
to determine whether the sudo timestamp is still valid.
This works as intended, however the command takes ca. 15 ms to complete. Actually all sudo
commands seem to have this overhead. This is not much, but I notice it and it bothers me. Given that this is not a computationally expensive operation, is there is a faster way to check this?
sudo zsh performance real-time
@JeffSchaller How exactly would that work?
– 0x539
Apr 10 at 23:18
I've run out of ideas; even ifsudo -n true
passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.
– Jeff Schaller♦
Apr 11 at 0:17
add a comment |
I want my zsh prompt to display whether the session has sudo rights (from a previously run sudo
command). After looking at the answers to this question, I arranged to use the exit status of sudo -n true
to determine whether the sudo timestamp is still valid.
This works as intended, however the command takes ca. 15 ms to complete. Actually all sudo
commands seem to have this overhead. This is not much, but I notice it and it bothers me. Given that this is not a computationally expensive operation, is there is a faster way to check this?
sudo zsh performance real-time
I want my zsh prompt to display whether the session has sudo rights (from a previously run sudo
command). After looking at the answers to this question, I arranged to use the exit status of sudo -n true
to determine whether the sudo timestamp is still valid.
This works as intended, however the command takes ca. 15 ms to complete. Actually all sudo
commands seem to have this overhead. This is not much, but I notice it and it bothers me. Given that this is not a computationally expensive operation, is there is a faster way to check this?
sudo zsh performance real-time
sudo zsh performance real-time
edited Apr 10 at 23:08
Jeff Schaller♦
45k1164147
45k1164147
asked Apr 10 at 22:32
0x5390x539
12614
12614
@JeffSchaller How exactly would that work?
– 0x539
Apr 10 at 23:18
I've run out of ideas; even ifsudo -n true
passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.
– Jeff Schaller♦
Apr 11 at 0:17
add a comment |
@JeffSchaller How exactly would that work?
– 0x539
Apr 10 at 23:18
I've run out of ideas; even ifsudo -n true
passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.
– Jeff Schaller♦
Apr 11 at 0:17
@JeffSchaller How exactly would that work?
– 0x539
Apr 10 at 23:18
@JeffSchaller How exactly would that work?
– 0x539
Apr 10 at 23:18
I've run out of ideas; even if
sudo -n true
passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.– Jeff Schaller♦
Apr 11 at 0:17
I've run out of ideas; even if
sudo -n true
passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.– Jeff Schaller♦
Apr 11 at 0:17
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511776%2fsmall-delay-in-sudo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511776%2fsmall-delay-in-sudo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
@JeffSchaller How exactly would that work?
– 0x539
Apr 10 at 23:18
I've run out of ideas; even if
sudo -n true
passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.– Jeff Schaller♦
Apr 11 at 0:17