automate the installation of packages and other things (you know, when reinstalling the OS to clean it up) and sometimes I need sudo privileges, but not always (sometimes it's even required to be a non-root user). If the shell script contains more than one sudo command, regardless of how many commands are in-between or how much time passes from one sudo command to the other, may the script prompt the sudo password again during its execution or it's enough to just type it for the first sudo command?
Tell me if I should explain it more clearly
Technically it should not and if it doesn't work you can try piping password to sudo command for automation
Yes, it will prompt again after some time, unless you launch the script itself with sudo.
Обсуждают сегодня