How come the following sudo command does not prompt for the password anymore?

Asked by chiao woei

I noticed lately that when i issued a sudo command the first time, it will asked me for my password but the following command will not. I also read from somewhere that there is a grace period but the funny thing is that closing the current terminal window and running again the sudo command in a new window also will not reasked me for the password. I also recalled that this wasn't the case previously. Btw, for your informations, the last couple of changes that i made were to installed apache2, php and mysql and i also change my root password.
Will this compromised my security?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu sudo Edit question
Assignee:
No assignee Edit question
Solved by:
williamts99
Solved:
Last query:
Last reply:
Revision history for this message
williamts99 (williamts99) said :
#1

Hello,

https://help.ubuntu.com/community/RootSudo

The password is stored by default for 15 minutes. After that time, you will need to enter your password again.

Best Regards,
Williamts99

Revision history for this message
chiao woei (yongchiaowoei) said :
#2

Thank you williamts99
Can you also tell me how to change the time from 15 minutes to a lesser
value pls.

Many thanks in advance

On Mon, 2008-02-11 at 18:35 +0000, williamts99 wrote:
> Your question #24409 on Ubuntu changed:
> https://answers.edge.launchpad.net/ubuntu/+question/24409
>
> Status: Open => Answered
>
> williamts99 proposed the following answer:
> Hello,
>
> https://help.ubuntu.com/community/RootSudo
>
> The password is stored by default for 15 minutes. After that time, you
> will need to enter your password again.
>
> Best Regards,
> Williamts99
>

Revision history for this message
Best williamts99 (williamts99) said :
#3

Hello,
Applications>Accessories>Terminal
sudo visudo

Then add/change the following line:

Defaults !lecture,tty_tickets,!fqdn

with

Defaults !lecture,tty_tickets,!fqdn,timestamp_timeout=2

The 2 being whatever time you want, in minutes.

Best Regards,
Williamts99

Revision history for this message
chiao woei (yongchiaowoei) said :
#4

Thank you for solving my problem williamts99

Revision history for this message
chiao woei (yongchiaowoei) said :
#5

Thank you williamts99. Yes, you solved my problem. But i still got one
statement to made. I change the timeout value to 1 minute and then i did
a test by checking the clock on the system tray. I noticed that it is
not very accurate. Is this normal friend?

On Tue, 2008-02-12 at 00:09 +0000, williamts99 wrote:
> Your question #24409 on Ubuntu changed:
> https://answers.edge.launchpad.net/ubuntu/+question/24409
>
> Status: Open => Answered
>
> williamts99 proposed the following answer:
> Hello,
> Applications>Accessories>Terminal
> sudo visudo
>
> Then add/change the following line:
>
> Defaults !lecture,tty_tickets,!fqdn
>
> with
>
> Defaults !lecture,tty_tickets,!fqdn,timestamp_timeout=2
>
> The 2 being whatever time you want, in minutes.
>
> Best Regards,
> Williamts99
>

Revision history for this message
williamts99 (williamts99) said :
#6

I'm not sure about that, I have only used the default and disabled completely, how close to a minute was it?

Revision history for this message
chiao woei (yongchiaowoei) said :
#7

around 3 minutes. To be more precise i will need to use a stopwatch.
Anyway, thank again for your help...

BYE

On Tue, 2008-02-12 at 16:17 +0000, williamts99 wrote:
> Your question #24409 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/24409
>
> williamts99 posted a new comment:
> I'm not sure about that, I have only used the default and disabled
> completely, how close to a minute was it?
>

Revision history for this message
williamts99 (williamts99) said :
#8

If you are running more sudo commands in between, it will reset the timer.

Best Regards,
Williamts99