I know I could just put something like
sudo mypassword in my
.bash_profile, but I don't want to run every command as root.
I want password to autofill under following circumstances:
- only the commands requiring root privileges
- only commands that I explicitly state I plan to run su to root with
sudo cd /var/root #When I type this Password: #I don't want to be prompted for my password #I want to fill it from my `.bash_profile`
cd /var/root #When I type this -bash: cd: /var/root: Permission denied #I still want this, or the like, returned
I saw this post on increasing sudo timeout, but I don't think it's quite equivalent. For example, I want it to carry across different shell log-in sessions. I could be wrong.
Any suggestions regarding what to (or not to!) add to my
.bash_profile, or which method (
timeout vs profile) is preferable would be greatly appreciated! Thank you in advance.