It's not really damaging but it's not a good idea and yes, it is a bit silly. Running sudo ./install
does not give root access to the program you are installing. It gives root access to the installer. What that will do is create the necessary directories (which are usually many, not one) and copy the relevant files into them and then set their permissions to whatever necessary for them to run.
Temporarily changing the permissions of a specific directory in /usr/local
does not make this process any safer. On the other hand, on the many occasions where a program's installation process needs multiple directories such as /usr/local/bin
, /usr/local/share
, /usr/local/share/doc
etc, your approach will fail unless you manually check all needed directories and set their permissions. That is a far greater security risk since it is very likely that you will forget to set some of these back to the correct permissions.
You should also be aware that in modern Linux systems such as Mint, there are very few cases where you need to manually install software. Most things you will ever need are available in Mint's and Ubuntu's repositories and you can install them using either apt-get
or aptitude
from the command line or you can use synaptic
or the Software Center for a graphical interface.