Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sudo password timeout #10

Open
andrimanna opened this issue Apr 13, 2020 · 1 comment
Open

Fix sudo password timeout #10

andrimanna opened this issue Apr 13, 2020 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed pre-golden

Comments

@andrimanna
Copy link
Member

andrimanna commented Apr 13, 2020

maybe with sudo -i?

@andrimanna andrimanna added bug Something isn't working help wanted Extra attention is needed labels Apr 13, 2020
@lvps
Copy link
Member

lvps commented Apr 13, 2020

There are 2 parameters that can be added to the sudoers file:

  • passwd_timeout controls the timeout for the "Type your password here NOW:" prompt
  • timestamp_timeout controls how long sudo will keep your cached password (or authorization or something, I hope it doesn't actually cache a plaintext password)

Would one of these resolve the issue?

Unfortunately I see no way to pass these to sudo other than editing the configuration file, but we can use sudo once to customize it at the beginning, if it's quick enough everything should work smoothly.

sudo -i will log you in as another user and wait forever for a command, so it's probably no good. If we really want, we can use the script to re-launch itself with sudo but I don't really like this approach:

if [[ $EUID -ne 0 ]]; then
  sudo $0 # or something, this is actually absurdly complicated in bash
  exit
fi

# do the usual stuff here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed pre-golden
Projects
None yet
Development

No branches or pull requests

2 participants