How To Force Users To Enter Sudo Password For Each Command In Ubuntu

By default, in Ubuntu the sudo password is remembered for 15 minutes after entering it. Users don’t have to enter the password for any other sudo commands during this time. If you want to force users to enter sudo password for each sudo command, then follow below guide.

Force Password Authentication In Ubuntu

Open the terminal app (ctrl+alt+t) and run below command. It will open the /etc/sudoers file in nano editor.

sudo visudo

Now add ” timestamp_timeout=0″ (place cursor using arrow keys and start typing or copy paste) in “Defaults env_reset” line like below.

Defaults env_reset, timestamp_timeout=0

Force Users To Enter Sudo Password For Each Command

After that press Ctrl+X keys followed by Y to save the changes and close the nano editor. And restart Ubuntu. Now it will change your Sudo Password Timeout to 0 minutes. That means you need to enter the sudo password for each sudo command on your Ubuntu Linux system.

If you liked this article, please subscribe to our YouTube Channel. You can also stay connected with us on X (Twitter) and Facebook.



Also Read:  Best Terminal Emulators for Linux

Leave a Reply