malachi1990
August 17th, 2009, 10:47 PM
So I'm teaching myself bash scripting, and as my first attempt, I created this basic script to update my system and clean out unneeded packages:
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get autoremove && sudo apt-get autoclean
So i set this up and just to see what happens, executed it with normal user privileges. And it (the script) happily does everything, not once asking me for a password. Had I entered the commands manually, I would have needed to enter my sudo password.
Definitely points out the greatness of package managers, but also a serious security risk for anyone who decides to download third party scripts for any reason (unless the downloaded script would require sudo to run?).
**NOTE** this is on karmic koala, and may not apply to other releases.
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get autoremove && sudo apt-get autoclean
So i set this up and just to see what happens, executed it with normal user privileges. And it (the script) happily does everything, not once asking me for a password. Had I entered the commands manually, I would have needed to enter my sudo password.
Definitely points out the greatness of package managers, but also a serious security risk for anyone who decides to download third party scripts for any reason (unless the downloaded script would require sudo to run?).
**NOTE** this is on karmic koala, and may not apply to other releases.