How often is the password asked for sudo commands? Where can I set it up?Why does the terminal not hold my root password for sudo?Increase duration of SudoSudo is working without password? Is this a bug?How to change the timeout between sudo sessions?How to modify an invalid '/etc/sudoers' file?Timeout for password input for user loginA noob question about sudo -sHow come you don't need sudo privileges to update the packages list in the 10.10 Update Manager?Why does sudo ask for a password in window after I've just authenticated in a different one?Sudo: No password for certain command for everybody (including domain users)How to check if sudo password has been entered for this terminal session?How can I force sudo to always ask for a password after waking from suspend?How to prevent scripts/commands hijacking your session's cached sudo ability?How do I run a sudo command needing password input in the background?Change a user's password with the usermod and ssh commandsLock copy-paste input to terminal while sudo prompts for password

Does Hogwarts have its own anthem?

Actual Steps in Step Definition or Call Test Cases in Step Definition, What's the Best Practice?

How is this situation not a checkmate?

How to restrict deletion of specific row of SQL server table

What would the EU’s position be with respect to a United Ireland?

Is right click on tables bad UX

Manager told a colleague of mine I was getting fired soon

Why do personal finance apps focus on outgoings rather than income

Is American Sign Language phonetic?

C - Learning Linked Lists, Pointer Manipulation - Store some ints, print and free memory

Is there any printer at Taiwan Taoyuan International Airport (TPE) that airline passengers can use?

Tikz background color of node multilayer

Can I voluntarily exit from the US after a 20 year overstay, or could I be detained at the airport?

Why does the Pilatus PC-24 have such a large "Wing Support"?

Does the 'java' command compile Java programs?

How to plausibly write a character with a hidden skill

Could the Queen overturn the UK Supreme Court ruling regarding prorogation of Parliament?

How long does Xendros from Ghosts of Saltmarsh need for this downtime activity?

Would houseruling two or more instances of resistance to the same element as immunity be overly unbalanced?

Determining if auto stats update is in progress

Help in Translation of "zu+participle" Construction

Bouldering Vs Rock Climbing

electricity bill doubled

What is this symbol?



How often is the password asked for sudo commands? Where can I set it up?


Why does the terminal not hold my root password for sudo?Increase duration of SudoSudo is working without password? Is this a bug?How to change the timeout between sudo sessions?How to modify an invalid '/etc/sudoers' file?Timeout for password input for user loginA noob question about sudo -sHow come you don't need sudo privileges to update the packages list in the 10.10 Update Manager?Why does sudo ask for a password in window after I've just authenticated in a different one?Sudo: No password for certain command for everybody (including domain users)How to check if sudo password has been entered for this terminal session?How can I force sudo to always ask for a password after waking from suspend?How to prevent scripts/commands hijacking your session's cached sudo ability?How do I run a sudo command needing password input in the background?Change a user's password with the usermod and ssh commandsLock copy-paste input to terminal while sudo prompts for password






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









24















I execute quite a lot of sudo commands.



I noticed that if I execute one and then another one within few minutes, the 2nd time I don't get the message:




[sudo] password for my_username:




but I do get it when there is more time between the execution of the two commands.



What's the period of time in which the message is not appearing? How can we check it / update it?










share|improve this question





















  • 1





    sudo visudo, then %sudo line should be %sudo ALL=(ALL:ALL)NOPASSWD: ALL , it will not ask you any password when you type sudo any-stuff

    – Qasim
    Jun 17 '13 at 11:41






  • 3





    This (NOPASSWD:ALL) is a very dangerous suggestion. It will make your installation unsecured.

    – Sri
    Jun 19 '13 at 5:24

















24















I execute quite a lot of sudo commands.



I noticed that if I execute one and then another one within few minutes, the 2nd time I don't get the message:




[sudo] password for my_username:




but I do get it when there is more time between the execution of the two commands.



What's the period of time in which the message is not appearing? How can we check it / update it?










share|improve this question





















  • 1





    sudo visudo, then %sudo line should be %sudo ALL=(ALL:ALL)NOPASSWD: ALL , it will not ask you any password when you type sudo any-stuff

    – Qasim
    Jun 17 '13 at 11:41






  • 3





    This (NOPASSWD:ALL) is a very dangerous suggestion. It will make your installation unsecured.

    – Sri
    Jun 19 '13 at 5:24













24












24








24


5






I execute quite a lot of sudo commands.



I noticed that if I execute one and then another one within few minutes, the 2nd time I don't get the message:




[sudo] password for my_username:




but I do get it when there is more time between the execution of the two commands.



What's the period of time in which the message is not appearing? How can we check it / update it?










share|improve this question
















I execute quite a lot of sudo commands.



I noticed that if I execute one and then another one within few minutes, the 2nd time I don't get the message:




[sudo] password for my_username:




but I do get it when there is more time between the execution of the two commands.



What's the period of time in which the message is not appearing? How can we check it / update it?







sudo






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 7 '14 at 12:45









Braiam

54.3k21 gold badges146 silver badges230 bronze badges




54.3k21 gold badges146 silver badges230 bronze badges










asked Jun 17 '13 at 11:22









fedorquifedorqui

7,2341 gold badge13 silver badges35 bronze badges




7,2341 gold badge13 silver badges35 bronze badges










  • 1





    sudo visudo, then %sudo line should be %sudo ALL=(ALL:ALL)NOPASSWD: ALL , it will not ask you any password when you type sudo any-stuff

    – Qasim
    Jun 17 '13 at 11:41






  • 3





    This (NOPASSWD:ALL) is a very dangerous suggestion. It will make your installation unsecured.

    – Sri
    Jun 19 '13 at 5:24












  • 1





    sudo visudo, then %sudo line should be %sudo ALL=(ALL:ALL)NOPASSWD: ALL , it will not ask you any password when you type sudo any-stuff

    – Qasim
    Jun 17 '13 at 11:41






  • 3





    This (NOPASSWD:ALL) is a very dangerous suggestion. It will make your installation unsecured.

    – Sri
    Jun 19 '13 at 5:24







1




1





sudo visudo, then %sudo line should be %sudo ALL=(ALL:ALL)NOPASSWD: ALL , it will not ask you any password when you type sudo any-stuff

– Qasim
Jun 17 '13 at 11:41





sudo visudo, then %sudo line should be %sudo ALL=(ALL:ALL)NOPASSWD: ALL , it will not ask you any password when you type sudo any-stuff

– Qasim
Jun 17 '13 at 11:41




3




3





This (NOPASSWD:ALL) is a very dangerous suggestion. It will make your installation unsecured.

– Sri
Jun 19 '13 at 5:24





This (NOPASSWD:ALL) is a very dangerous suggestion. It will make your installation unsecured.

– Sri
Jun 19 '13 at 5:24










3 Answers
3






active

oldest

votes


















31
















The default timeout of sudo is 15 minutes; that is, sudo will remember your password for 15 minutes by default.



You can modify this default timeout by adding a string in the file /etc/sudoers. However, you don't modify the file directly, but instead you use the command sudo visudo.



So, type sudo visudo in a terminal. This will open up the (actually, a temporary) file for us to edit, using your preferred editor.




Note: if you are using visudo for the first time, you should be asked which editor you would like to use, so choose your editor. There's no "better" editor, but I prefer nano. If you've already used visudo and chose an editor before, but you want to use another editor for the time being, you can do sudo EDITOR=vi visudo to use vi, or change it to nano to use nano. If you want to permanently change your preferred editor, do sudo update-alternatives --config editor.




Look for this line:



Defaults env_reset


And add timestamp_timeout=X (with a comma) at the end of it, where X is the time you want to set in minutes.



So your line should look like this, as an example:



Defaults env_reset,timestamp_timeout=5


If you specify 0, you will always be asked the password. If you specify a negative value, the timeout will never expire.



Once done, save and exit.



Source: RootSudoTimeout






share|improve this answer



























  • Thank you, @Alaa, it is a good and helpful answer. Just as a side note, the Ctrl + x part is not always matched as the editor can be for example vi (in my case).

    – fedorqui
    Jun 17 '13 at 13:42











  • By the way, I did a big mistake adding a new line with only Default timestamp-0 instead of the one with env_reset. It broke my sudoers file. Had to use askubuntu.com/a/73872/143251 to solve it!

    – fedorqui
    Jun 17 '13 at 13:45











  • @fedorqui: That is exactly why you should use visudo (as Alaa recommends) instead of editing the file directly. The former will syntax check the file for you, preventing you from locking yourself out of sudo.

    – Plutor
    Jun 17 '13 at 14:20











  • Yes, yes, that's what I did @Plutor . But vi is the editor I have defined for visudo. The problem is that I saved the file although I got a warning message when closing it. My fault, obviously.

    – fedorqui
    Jun 17 '13 at 14:25






  • 1





    @fedorqui, yeah I sort of wanted to remove that part because anyone could be using a different editor. I've edited my answer to not be editor specific.

    – Alaa Ali
    Jun 17 '13 at 17:24


















3
















See this post here: http://ubuntuforums.org/showthread.php?p=116697#post116697



Edit /etc/sudoers file, use sudo visudo command for safety. Add timestamp_timeout=0 to the line starting Defaults to ask everytime, or positive X for X minute delay.






share|improve this answer






















  • 1





    I have to register in the forum to see it. In the meanwhile, could you kindly indicate which file should I edit with timestamp_timeout=0 line?

    – fedorqui
    Jun 17 '13 at 11:31











  • OK, fixed answer.

    – Tuminoid
    Jun 17 '13 at 11:37











  • It did the trick! I will accept the other answer as it has a more comprehensive explanation and includes the env_reset reference, which is important. Anyway this your answer was also very helpful, so thanks!

    – fedorqui
    Jun 17 '13 at 13:47


















0
















Not sure if this expires or not, but you could try



sudo su


It will ask you for the password and after that all commands are run as sudo.






share|improve this answer




















  • 1





    Yes, @Rat2000, but I want to keep using my user and not root. I think it is safer. Anyway, thanks for the advice.

    – fedorqui
    Jun 17 '13 at 13:46







  • 3





    sudo su makes you become root. Your prompt should then be root@yourpc. Mind that root has it's own .bashrc, so your aliases won't work. Mind also that root can do severe damage to the system, so be careful!

    – speter
    Jun 17 '13 at 17:00













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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/4.0/"u003ecc by-sa 4.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
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f309202%2fhow-often-is-the-password-asked-for-sudo-commands-where-can-i-set-it-up%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









31
















The default timeout of sudo is 15 minutes; that is, sudo will remember your password for 15 minutes by default.



You can modify this default timeout by adding a string in the file /etc/sudoers. However, you don't modify the file directly, but instead you use the command sudo visudo.



So, type sudo visudo in a terminal. This will open up the (actually, a temporary) file for us to edit, using your preferred editor.




Note: if you are using visudo for the first time, you should be asked which editor you would like to use, so choose your editor. There's no "better" editor, but I prefer nano. If you've already used visudo and chose an editor before, but you want to use another editor for the time being, you can do sudo EDITOR=vi visudo to use vi, or change it to nano to use nano. If you want to permanently change your preferred editor, do sudo update-alternatives --config editor.




Look for this line:



Defaults env_reset


And add timestamp_timeout=X (with a comma) at the end of it, where X is the time you want to set in minutes.



So your line should look like this, as an example:



Defaults env_reset,timestamp_timeout=5


If you specify 0, you will always be asked the password. If you specify a negative value, the timeout will never expire.



Once done, save and exit.



Source: RootSudoTimeout






share|improve this answer



























  • Thank you, @Alaa, it is a good and helpful answer. Just as a side note, the Ctrl + x part is not always matched as the editor can be for example vi (in my case).

    – fedorqui
    Jun 17 '13 at 13:42











  • By the way, I did a big mistake adding a new line with only Default timestamp-0 instead of the one with env_reset. It broke my sudoers file. Had to use askubuntu.com/a/73872/143251 to solve it!

    – fedorqui
    Jun 17 '13 at 13:45











  • @fedorqui: That is exactly why you should use visudo (as Alaa recommends) instead of editing the file directly. The former will syntax check the file for you, preventing you from locking yourself out of sudo.

    – Plutor
    Jun 17 '13 at 14:20











  • Yes, yes, that's what I did @Plutor . But vi is the editor I have defined for visudo. The problem is that I saved the file although I got a warning message when closing it. My fault, obviously.

    – fedorqui
    Jun 17 '13 at 14:25






  • 1





    @fedorqui, yeah I sort of wanted to remove that part because anyone could be using a different editor. I've edited my answer to not be editor specific.

    – Alaa Ali
    Jun 17 '13 at 17:24















31
















The default timeout of sudo is 15 minutes; that is, sudo will remember your password for 15 minutes by default.



You can modify this default timeout by adding a string in the file /etc/sudoers. However, you don't modify the file directly, but instead you use the command sudo visudo.



So, type sudo visudo in a terminal. This will open up the (actually, a temporary) file for us to edit, using your preferred editor.




Note: if you are using visudo for the first time, you should be asked which editor you would like to use, so choose your editor. There's no "better" editor, but I prefer nano. If you've already used visudo and chose an editor before, but you want to use another editor for the time being, you can do sudo EDITOR=vi visudo to use vi, or change it to nano to use nano. If you want to permanently change your preferred editor, do sudo update-alternatives --config editor.




Look for this line:



Defaults env_reset


And add timestamp_timeout=X (with a comma) at the end of it, where X is the time you want to set in minutes.



So your line should look like this, as an example:



Defaults env_reset,timestamp_timeout=5


If you specify 0, you will always be asked the password. If you specify a negative value, the timeout will never expire.



Once done, save and exit.



Source: RootSudoTimeout






share|improve this answer



























  • Thank you, @Alaa, it is a good and helpful answer. Just as a side note, the Ctrl + x part is not always matched as the editor can be for example vi (in my case).

    – fedorqui
    Jun 17 '13 at 13:42











  • By the way, I did a big mistake adding a new line with only Default timestamp-0 instead of the one with env_reset. It broke my sudoers file. Had to use askubuntu.com/a/73872/143251 to solve it!

    – fedorqui
    Jun 17 '13 at 13:45











  • @fedorqui: That is exactly why you should use visudo (as Alaa recommends) instead of editing the file directly. The former will syntax check the file for you, preventing you from locking yourself out of sudo.

    – Plutor
    Jun 17 '13 at 14:20











  • Yes, yes, that's what I did @Plutor . But vi is the editor I have defined for visudo. The problem is that I saved the file although I got a warning message when closing it. My fault, obviously.

    – fedorqui
    Jun 17 '13 at 14:25






  • 1





    @fedorqui, yeah I sort of wanted to remove that part because anyone could be using a different editor. I've edited my answer to not be editor specific.

    – Alaa Ali
    Jun 17 '13 at 17:24













31














31










31









The default timeout of sudo is 15 minutes; that is, sudo will remember your password for 15 minutes by default.



You can modify this default timeout by adding a string in the file /etc/sudoers. However, you don't modify the file directly, but instead you use the command sudo visudo.



So, type sudo visudo in a terminal. This will open up the (actually, a temporary) file for us to edit, using your preferred editor.




Note: if you are using visudo for the first time, you should be asked which editor you would like to use, so choose your editor. There's no "better" editor, but I prefer nano. If you've already used visudo and chose an editor before, but you want to use another editor for the time being, you can do sudo EDITOR=vi visudo to use vi, or change it to nano to use nano. If you want to permanently change your preferred editor, do sudo update-alternatives --config editor.




Look for this line:



Defaults env_reset


And add timestamp_timeout=X (with a comma) at the end of it, where X is the time you want to set in minutes.



So your line should look like this, as an example:



Defaults env_reset,timestamp_timeout=5


If you specify 0, you will always be asked the password. If you specify a negative value, the timeout will never expire.



Once done, save and exit.



Source: RootSudoTimeout






share|improve this answer















The default timeout of sudo is 15 minutes; that is, sudo will remember your password for 15 minutes by default.



You can modify this default timeout by adding a string in the file /etc/sudoers. However, you don't modify the file directly, but instead you use the command sudo visudo.



So, type sudo visudo in a terminal. This will open up the (actually, a temporary) file for us to edit, using your preferred editor.




Note: if you are using visudo for the first time, you should be asked which editor you would like to use, so choose your editor. There's no "better" editor, but I prefer nano. If you've already used visudo and chose an editor before, but you want to use another editor for the time being, you can do sudo EDITOR=vi visudo to use vi, or change it to nano to use nano. If you want to permanently change your preferred editor, do sudo update-alternatives --config editor.




Look for this line:



Defaults env_reset


And add timestamp_timeout=X (with a comma) at the end of it, where X is the time you want to set in minutes.



So your line should look like this, as an example:



Defaults env_reset,timestamp_timeout=5


If you specify 0, you will always be asked the password. If you specify a negative value, the timeout will never expire.



Once done, save and exit.



Source: RootSudoTimeout







share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 17 '13 at 17:20

























answered Jun 17 '13 at 11:38









Alaa AliAlaa Ali

23.7k9 gold badges73 silver badges95 bronze badges




23.7k9 gold badges73 silver badges95 bronze badges















  • Thank you, @Alaa, it is a good and helpful answer. Just as a side note, the Ctrl + x part is not always matched as the editor can be for example vi (in my case).

    – fedorqui
    Jun 17 '13 at 13:42











  • By the way, I did a big mistake adding a new line with only Default timestamp-0 instead of the one with env_reset. It broke my sudoers file. Had to use askubuntu.com/a/73872/143251 to solve it!

    – fedorqui
    Jun 17 '13 at 13:45











  • @fedorqui: That is exactly why you should use visudo (as Alaa recommends) instead of editing the file directly. The former will syntax check the file for you, preventing you from locking yourself out of sudo.

    – Plutor
    Jun 17 '13 at 14:20











  • Yes, yes, that's what I did @Plutor . But vi is the editor I have defined for visudo. The problem is that I saved the file although I got a warning message when closing it. My fault, obviously.

    – fedorqui
    Jun 17 '13 at 14:25






  • 1





    @fedorqui, yeah I sort of wanted to remove that part because anyone could be using a different editor. I've edited my answer to not be editor specific.

    – Alaa Ali
    Jun 17 '13 at 17:24

















  • Thank you, @Alaa, it is a good and helpful answer. Just as a side note, the Ctrl + x part is not always matched as the editor can be for example vi (in my case).

    – fedorqui
    Jun 17 '13 at 13:42











  • By the way, I did a big mistake adding a new line with only Default timestamp-0 instead of the one with env_reset. It broke my sudoers file. Had to use askubuntu.com/a/73872/143251 to solve it!

    – fedorqui
    Jun 17 '13 at 13:45











  • @fedorqui: That is exactly why you should use visudo (as Alaa recommends) instead of editing the file directly. The former will syntax check the file for you, preventing you from locking yourself out of sudo.

    – Plutor
    Jun 17 '13 at 14:20











  • Yes, yes, that's what I did @Plutor . But vi is the editor I have defined for visudo. The problem is that I saved the file although I got a warning message when closing it. My fault, obviously.

    – fedorqui
    Jun 17 '13 at 14:25






  • 1





    @fedorqui, yeah I sort of wanted to remove that part because anyone could be using a different editor. I've edited my answer to not be editor specific.

    – Alaa Ali
    Jun 17 '13 at 17:24
















Thank you, @Alaa, it is a good and helpful answer. Just as a side note, the Ctrl + x part is not always matched as the editor can be for example vi (in my case).

– fedorqui
Jun 17 '13 at 13:42





Thank you, @Alaa, it is a good and helpful answer. Just as a side note, the Ctrl + x part is not always matched as the editor can be for example vi (in my case).

– fedorqui
Jun 17 '13 at 13:42













By the way, I did a big mistake adding a new line with only Default timestamp-0 instead of the one with env_reset. It broke my sudoers file. Had to use askubuntu.com/a/73872/143251 to solve it!

– fedorqui
Jun 17 '13 at 13:45





By the way, I did a big mistake adding a new line with only Default timestamp-0 instead of the one with env_reset. It broke my sudoers file. Had to use askubuntu.com/a/73872/143251 to solve it!

– fedorqui
Jun 17 '13 at 13:45













@fedorqui: That is exactly why you should use visudo (as Alaa recommends) instead of editing the file directly. The former will syntax check the file for you, preventing you from locking yourself out of sudo.

– Plutor
Jun 17 '13 at 14:20





@fedorqui: That is exactly why you should use visudo (as Alaa recommends) instead of editing the file directly. The former will syntax check the file for you, preventing you from locking yourself out of sudo.

– Plutor
Jun 17 '13 at 14:20













Yes, yes, that's what I did @Plutor . But vi is the editor I have defined for visudo. The problem is that I saved the file although I got a warning message when closing it. My fault, obviously.

– fedorqui
Jun 17 '13 at 14:25





Yes, yes, that's what I did @Plutor . But vi is the editor I have defined for visudo. The problem is that I saved the file although I got a warning message when closing it. My fault, obviously.

– fedorqui
Jun 17 '13 at 14:25




1




1





@fedorqui, yeah I sort of wanted to remove that part because anyone could be using a different editor. I've edited my answer to not be editor specific.

– Alaa Ali
Jun 17 '13 at 17:24





@fedorqui, yeah I sort of wanted to remove that part because anyone could be using a different editor. I've edited my answer to not be editor specific.

– Alaa Ali
Jun 17 '13 at 17:24













3
















See this post here: http://ubuntuforums.org/showthread.php?p=116697#post116697



Edit /etc/sudoers file, use sudo visudo command for safety. Add timestamp_timeout=0 to the line starting Defaults to ask everytime, or positive X for X minute delay.






share|improve this answer






















  • 1





    I have to register in the forum to see it. In the meanwhile, could you kindly indicate which file should I edit with timestamp_timeout=0 line?

    – fedorqui
    Jun 17 '13 at 11:31











  • OK, fixed answer.

    – Tuminoid
    Jun 17 '13 at 11:37











  • It did the trick! I will accept the other answer as it has a more comprehensive explanation and includes the env_reset reference, which is important. Anyway this your answer was also very helpful, so thanks!

    – fedorqui
    Jun 17 '13 at 13:47















3
















See this post here: http://ubuntuforums.org/showthread.php?p=116697#post116697



Edit /etc/sudoers file, use sudo visudo command for safety. Add timestamp_timeout=0 to the line starting Defaults to ask everytime, or positive X for X minute delay.






share|improve this answer






















  • 1





    I have to register in the forum to see it. In the meanwhile, could you kindly indicate which file should I edit with timestamp_timeout=0 line?

    – fedorqui
    Jun 17 '13 at 11:31











  • OK, fixed answer.

    – Tuminoid
    Jun 17 '13 at 11:37











  • It did the trick! I will accept the other answer as it has a more comprehensive explanation and includes the env_reset reference, which is important. Anyway this your answer was also very helpful, so thanks!

    – fedorqui
    Jun 17 '13 at 13:47













3














3










3









See this post here: http://ubuntuforums.org/showthread.php?p=116697#post116697



Edit /etc/sudoers file, use sudo visudo command for safety. Add timestamp_timeout=0 to the line starting Defaults to ask everytime, or positive X for X minute delay.






share|improve this answer















See this post here: http://ubuntuforums.org/showthread.php?p=116697#post116697



Edit /etc/sudoers file, use sudo visudo command for safety. Add timestamp_timeout=0 to the line starting Defaults to ask everytime, or positive X for X minute delay.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 17 '13 at 11:37

























answered Jun 17 '13 at 11:28









TuminoidTuminoid

3,32916 silver badges27 bronze badges




3,32916 silver badges27 bronze badges










  • 1





    I have to register in the forum to see it. In the meanwhile, could you kindly indicate which file should I edit with timestamp_timeout=0 line?

    – fedorqui
    Jun 17 '13 at 11:31











  • OK, fixed answer.

    – Tuminoid
    Jun 17 '13 at 11:37











  • It did the trick! I will accept the other answer as it has a more comprehensive explanation and includes the env_reset reference, which is important. Anyway this your answer was also very helpful, so thanks!

    – fedorqui
    Jun 17 '13 at 13:47












  • 1





    I have to register in the forum to see it. In the meanwhile, could you kindly indicate which file should I edit with timestamp_timeout=0 line?

    – fedorqui
    Jun 17 '13 at 11:31











  • OK, fixed answer.

    – Tuminoid
    Jun 17 '13 at 11:37











  • It did the trick! I will accept the other answer as it has a more comprehensive explanation and includes the env_reset reference, which is important. Anyway this your answer was also very helpful, so thanks!

    – fedorqui
    Jun 17 '13 at 13:47







1




1





I have to register in the forum to see it. In the meanwhile, could you kindly indicate which file should I edit with timestamp_timeout=0 line?

– fedorqui
Jun 17 '13 at 11:31





I have to register in the forum to see it. In the meanwhile, could you kindly indicate which file should I edit with timestamp_timeout=0 line?

– fedorqui
Jun 17 '13 at 11:31













OK, fixed answer.

– Tuminoid
Jun 17 '13 at 11:37





OK, fixed answer.

– Tuminoid
Jun 17 '13 at 11:37













It did the trick! I will accept the other answer as it has a more comprehensive explanation and includes the env_reset reference, which is important. Anyway this your answer was also very helpful, so thanks!

– fedorqui
Jun 17 '13 at 13:47





It did the trick! I will accept the other answer as it has a more comprehensive explanation and includes the env_reset reference, which is important. Anyway this your answer was also very helpful, so thanks!

– fedorqui
Jun 17 '13 at 13:47











0
















Not sure if this expires or not, but you could try



sudo su


It will ask you for the password and after that all commands are run as sudo.






share|improve this answer




















  • 1





    Yes, @Rat2000, but I want to keep using my user and not root. I think it is safer. Anyway, thanks for the advice.

    – fedorqui
    Jun 17 '13 at 13:46







  • 3





    sudo su makes you become root. Your prompt should then be root@yourpc. Mind that root has it's own .bashrc, so your aliases won't work. Mind also that root can do severe damage to the system, so be careful!

    – speter
    Jun 17 '13 at 17:00
















0
















Not sure if this expires or not, but you could try



sudo su


It will ask you for the password and after that all commands are run as sudo.






share|improve this answer




















  • 1





    Yes, @Rat2000, but I want to keep using my user and not root. I think it is safer. Anyway, thanks for the advice.

    – fedorqui
    Jun 17 '13 at 13:46







  • 3





    sudo su makes you become root. Your prompt should then be root@yourpc. Mind that root has it's own .bashrc, so your aliases won't work. Mind also that root can do severe damage to the system, so be careful!

    – speter
    Jun 17 '13 at 17:00














0














0










0









Not sure if this expires or not, but you could try



sudo su


It will ask you for the password and after that all commands are run as sudo.






share|improve this answer













Not sure if this expires or not, but you could try



sudo su


It will ask you for the password and after that all commands are run as sudo.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 17 '13 at 11:36









MihaiMihai

1,54115 silver badges17 bronze badges




1,54115 silver badges17 bronze badges










  • 1





    Yes, @Rat2000, but I want to keep using my user and not root. I think it is safer. Anyway, thanks for the advice.

    – fedorqui
    Jun 17 '13 at 13:46







  • 3





    sudo su makes you become root. Your prompt should then be root@yourpc. Mind that root has it's own .bashrc, so your aliases won't work. Mind also that root can do severe damage to the system, so be careful!

    – speter
    Jun 17 '13 at 17:00













  • 1





    Yes, @Rat2000, but I want to keep using my user and not root. I think it is safer. Anyway, thanks for the advice.

    – fedorqui
    Jun 17 '13 at 13:46







  • 3





    sudo su makes you become root. Your prompt should then be root@yourpc. Mind that root has it's own .bashrc, so your aliases won't work. Mind also that root can do severe damage to the system, so be careful!

    – speter
    Jun 17 '13 at 17:00








1




1





Yes, @Rat2000, but I want to keep using my user and not root. I think it is safer. Anyway, thanks for the advice.

– fedorqui
Jun 17 '13 at 13:46






Yes, @Rat2000, but I want to keep using my user and not root. I think it is safer. Anyway, thanks for the advice.

– fedorqui
Jun 17 '13 at 13:46





3




3





sudo su makes you become root. Your prompt should then be root@yourpc. Mind that root has it's own .bashrc, so your aliases won't work. Mind also that root can do severe damage to the system, so be careful!

– speter
Jun 17 '13 at 17:00






sudo su makes you become root. Your prompt should then be root@yourpc. Mind that root has it's own .bashrc, so your aliases won't work. Mind also that root can do severe damage to the system, so be careful!

– speter
Jun 17 '13 at 17:00



















draft saved

draft discarded















































Thanks for contributing an answer to Ask Ubuntu!


  • 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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f309202%2fhow-often-is-the-password-asked-for-sudo-commands-where-can-i-set-it-up%23new-answer', 'question_page');

);

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







Popular posts from this blog

Distance measures on a map of a game The 2019 Stack Overflow Developer Survey Results Are Inmin distance in a graphShortest distance path on contour plotHow to plot a tilted map?Finding points outside of a diskDelaunay link distanceAnnulus from GeoDisks: drawing a ring on a mapNegative Correlation DistanceFind distance along a path (GPS coordinates)Finding position at given distance in a GeoPathMathematics behind distance estimation using camera

How to get a smooth, uniform ParametricPlot of a 2D Region?How to plot a complicated Region?How to exclude a region from ParametricPlotHow discretize a region placing vertices on a specific non-uniform gridHow to transform a Plot or a ParametricPlot into a RegionHow can I get a smooth plot of a bounded region?Smooth ParametricPlot3D with RegionFunction?Smooth border of a region ParametricPlotSmooth region boundarySmooth region plot from list of pointsGet minimum y of a certain x in a region

Genealogie vun de Merowenger Vum Merowech bis zum Chilperich I. | Navigatiounsmenü