Pages

Friday, June 2, 2017

How to Keep ‘sudo’ Password Timeout Session Longer in Linux

In recent articles, we’ve showed you 10 Useful Sudoers Configurations in Linux and Let Sudo Insult You When You Enter Incorrect Password, and in this article, we discovered a another sudo tip that will help you to make sudo password sessions (timeout) longer or shorter in Ubuntu Linux.
In Ubuntu and its derivatives such as Linux Mint or any other Ubuntu-based distro, when you execute a sudo command, it will prompt you to enter administrative password.
After you execute sudo command first time, the password will last for 15 minutes by default, so you don’t need to type password for every sudo command.

If, somehow you feel that the 15 minutes too long or short for some reason, you can change it with a easy tweak in sudoers file.
To set the sudo password timeout value, use the passwd_timeout parameter. First open the /etc/sudoers file with super user privileges using sudo and visudo commands like so:
$ sudo visudo 
Then add the following defaults entry, it implies that the sudo password prompt will time out after 20 minutes once sudo is invoked by a user.
Defaults        env_reset,timestamp_timeout=20
Note: You can set whatever time you want in minutes and make sure to wait before it times out. You can also set time to 0 if you want a password prompt for every sudo command you execute, or disable password prompt forever by setting the value -1.
The screen shot below show the defaults parameters I have set in my /ec/sudoers file.

      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1n5Z57
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment