How to get sudo to prompt you for a password each time

user364819

I find that if I execute something using sudo that then if I execute something else soon after also using sudo, that it does not prompt me for my password, and although this can be inconvenient in some situations, it is a security risk in others, and a hassle to keep on coming back and executing the command to make it prompt your for the password on the next go. So I was wondering if and how I could get it to prompt me every time, or for it to at least only remember my password for a very short amount of time?

Ron

Open Terminal and type:

sudo visudo

Then scroll down to the line that reads:

Defaults        env_reset

And change it to:

Defaults        env_reset,timestamp_timeout=0

You can change 0 to any values (time in minutes). Setting it to 0 will ask for your password every time and -1 will make it never ask. The default is 15 according to man sudo 8, but some manuals say the default is 5. Have a look at the RootSudoTimeout wiki for more information.

Press CTRL + X to finish editing, Y to save changes, and ENTER to exit.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Feedback when typing password at a sudo prompt

분류에서Dev

How to hide password in phonegap prompt

분류에서Dev

How do you sudo with xonsh?

분류에서Dev

Can you make `su` require a password, even if called with sudo?

분류에서Dev

How to get a prompt when switching to normal user account when you are already logged in as root

분류에서Dev

How do you give an "alert = prompt" a variable?

분류에서Dev

How to set Windows not to prompt for password on resume from sleep

분류에서Dev

In Windows 10 How To Keep Password Prompt From Appearing On Sleep?

분류에서Dev

How do I run a sudo command needing password input in the background?

분류에서Dev

Prompting for a password on sudo?

분류에서Dev

How to get the promptValue of AlertIOS.prompt

분류에서Dev

Permissions depending on how you login: ssh/su/sudo

분류에서Dev

How i can iterate list to get 10 elements each time in java

분류에서Dev

How can i get from the List<string> of files each time another file?

분류에서Dev

How can I use keypress and prompt libraries same time?

분류에서Dev

setting sudo password different from login password

분류에서Dev

how do I save a ftp password but get the plain password later

분류에서Dev

How do you Set Custom Time in Ubuntu?

분류에서Dev

How to get root Password in Kali Linux?

분류에서Dev

How do disable user list on login screen? (Prompt for username and password) Ubuntu 15.10

분류에서Dev

How to avoid encrypted boot partition password prompt in LVM- arch linux

분류에서Dev

How EC2 instances don't require password for sudo for Ubuntu user but 'include' is commented?

분류에서Dev

how to prompt user to get alert on press back space on focus out

분류에서Dev

How to get the arrow style bash prompt after installing powerline?

분류에서Dev

How to fix error while sudo apt-get upgrade

분류에서Dev

How can you show the login prompt on both monitors when logging in with Windows 7?

분류에서Dev

How to get the boot time of Ubuntu?

분류에서Dev

How to get Windows boot time?

분류에서Dev

How to get Windows boot time?

Related 관련 기사

  1. 1

    Feedback when typing password at a sudo prompt

  2. 2

    How to hide password in phonegap prompt

  3. 3

    How do you sudo with xonsh?

  4. 4

    Can you make `su` require a password, even if called with sudo?

  5. 5

    How to get a prompt when switching to normal user account when you are already logged in as root

  6. 6

    How do you give an "alert = prompt" a variable?

  7. 7

    How to set Windows not to prompt for password on resume from sleep

  8. 8

    In Windows 10 How To Keep Password Prompt From Appearing On Sleep?

  9. 9

    How do I run a sudo command needing password input in the background?

  10. 10

    Prompting for a password on sudo?

  11. 11

    How to get the promptValue of AlertIOS.prompt

  12. 12

    Permissions depending on how you login: ssh/su/sudo

  13. 13

    How i can iterate list to get 10 elements each time in java

  14. 14

    How can i get from the List<string> of files each time another file?

  15. 15

    How can I use keypress and prompt libraries same time?

  16. 16

    setting sudo password different from login password

  17. 17

    how do I save a ftp password but get the plain password later

  18. 18

    How do you Set Custom Time in Ubuntu?

  19. 19

    How to get root Password in Kali Linux?

  20. 20

    How do disable user list on login screen? (Prompt for username and password) Ubuntu 15.10

  21. 21

    How to avoid encrypted boot partition password prompt in LVM- arch linux

  22. 22

    How EC2 instances don't require password for sudo for Ubuntu user but 'include' is commented?

  23. 23

    how to prompt user to get alert on press back space on focus out

  24. 24

    How to get the arrow style bash prompt after installing powerline?

  25. 25

    How to fix error while sudo apt-get upgrade

  26. 26

    How can you show the login prompt on both monitors when logging in with Windows 7?

  27. 27

    How to get the boot time of Ubuntu?

  28. 28

    How to get Windows boot time?

  29. 29

    How to get Windows boot time?

뜨겁다태그

보관