0

Why does the terminal ask for a password when I run a command with sudo, even if I have already entered my password for another sudo command a while back in the same terminal.

Is there any way to change this setting?

Thanks

2 Answers 2

5

There is a timeout limit for security reasons. If you were working and took a break anyone coming to the terminal would have full access to the system if it didn't time out. The timeout is 15 minutes by default.

You can change the default time by editing changing the configuration with sudo visudo and adding a Defaults timestamp_timeout=# setting. The # is minutes. -1 would mean no timeout.

More details at: RootSudo Timeout

0

The sudo password wont be asked again for a short time after you first use it, if you want to extend that time in which you don't have to type the password again use:

sudo -v

You will be asked for your password, type it as usual, and once done, you can start running all the commands you want without introducing the password again.

1
  • Do you know what that "short time" is? And is there a way to change that time? Thanks
    – simplename
    Oct 18, 2016 at 16:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .