I have a bash script that installs a lot of software. The whole process takes around 1h therefore I would like to increase the sudo
timeout variable. I see it is possible as described here: Increase duration of Sudo.
However, I cannot find a description for the command line anywhere...
In my case I would like to make this change from within the script. I could put something like: sudo echo 'Defaults timestamp_timeout=300' >> /etc/sudoers
at the first line within the bash script. This, however, is not allowed.
sudo
s from inside the script, and run the whole script withsudo
– steeldriver Apr 25 '20 at 11:30sudo -u
for example)? – steeldriver Apr 25 '20 at 11:48$SUDO_USER
doesn't work for some reason? – steeldriver Apr 25 '20 at 11:57sudo -u $SUDO_USER cp DIR/file file
(being inside$HOME
) . I getcp failed to access 'file': Permission denied
. Is it possible to operate on$HOME
as non-root while the script was called withsudo
? – maciek Apr 26 '20 at 20:02$HOME
points to a different place whether calling the script with/withoutsudo
. Thank you for all the help! – maciek Apr 27 '20 at 10:48