4.9 C
Amsterdam
Saturday, December 5, 2020

How to change the default sudo timeout?

Must read

How To Install Docker Swarm On Ubuntu 20.04

In this tutorial, you'll learn that how to Install Docker Swarm on Ubuntu 20.04. Docker Swarm is most popular tool that can be used...

How To Install Keeweb Password Manager On Ubuntu 20.04

Today we are going to learn that how to install KeeWeb Passwrod Manager On Ubuntu 20.04. KeeWeb Password Manager provides the best and easy...

How to change the MAC address in Windows 10

Hello! How are you? Today we will see how to change the MAC address on a computer with Windows 10. In fact, it is...

How To Configure Slave BIND DNS Server On Ubuntu 20.04

In our previous guide we covered the setup of Master(Primary) DNS Server. Here we'll learn that how to configure slave bind dns server on...
angeloma
angeloma
Senior Writer and partner

Many times when working with sudo, we notice that it asks for a user password to execute the commands. However, after a while, if we want to use sudo again, we have to type it again. This is a security measure. Today I will show you how to change the default sudo timeout.

So, sudo program is part of the GNU suite. It is a small application that allows the execution of commands with the security privileges of another user. Normally, this “other” user is root.

Generally, Ubuntu-based distributions have sudo enabled. Although this is a security breach for many, it makes life much easier for newcomers.

On the other hand, the more server-oriented distributions like Debian, CentOS or RHEL do not even have it installed.

How to enable sudo on Debian 10?

However, sudo has a grace period. This is that after entering the password, there is a time when you can execute another command without entering the password again.

The previous situation implies a security breach. This has to be said. That’s why it’s possible to change that time to a shorter or a longer one.

Chaging the default sudo timeout

First, open a terminal session.

All sudo settings are stored in the /etc/sudoers file and need to be modified.

To do so, run the following command:

:~$ sudo nano /etc/sudoers

In this case I’m using a text editor called nano, but you can also use one with a graphical interface.

Once inside the file, you have to place the next line:

Defaults env_reset,timestamp_timeout=

However, in some Linux distributions that line does not exist, so you can add it at the end of the file and with the value in minutes you want. For example 1 for one minute.

In case you don’t want to be asked for the password anymore you can put the value one. Clearly this is not recommended at all.

Defaults env_reset,timestamp_timeout=1
1.- Change the default sudo timeout
1.- Change the default sudo timeout

Then save the changes and close the file.

And it’s done. Now after one minute, if you use another command with sudo, you will be asked for the password again.

Conclusion

Sudo is an unloved tool by many syadmin for being unsafe, but it is true that for a normal user of the system, it is a great advantage. Today you have learned how to modify the grace time it gives us without asking for the password.

Please share this post with your friends and join our Telegram channel.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

-

Latest article

How To Install Docker Swarm On Ubuntu 20.04

In this tutorial, you'll learn that how to Install Docker Swarm on Ubuntu 20.04. Docker Swarm is most popular tool that can be used...

How To Install Keeweb Password Manager On Ubuntu 20.04

Today we are going to learn that how to install KeeWeb Passwrod Manager On Ubuntu 20.04. KeeWeb Password Manager provides the best and easy...

How to change the MAC address in Windows 10

Hello! How are you? Today we will see how to change the MAC address on a computer with Windows 10. In fact, it is...

How To Configure Slave BIND DNS Server On Ubuntu 20.04

In our previous guide we covered the setup of Master(Primary) DNS Server. Here we'll learn that how to configure slave bind dns server on...

Install Fossil on Linux – An alternative to Git

Hello, friends. In this post, we will talk about a serious alternative to Git. In a few words, we'll show you how to install...
x