Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm running Linux Mint 16. When trying to install programs in the usr/local directory, instead of doing sudo ./install for the program, I've been creating the directory, the program wishes to install into, manually in the usr/local directory and changing the permissions of this directory, then after it has installed, I change the permissions back to default.

I've been doing this so as not to give root access to the program I'm installing for security reasons. Is this really silly and/or damaging or does it matter?

share|improve this question
    
If you want to change permissions of a dir, you have to be su. So even if you want to do it this way, you'll still have to use sudo for changing directory permissions, installing without sudo and then sudo again for changing permissions back :P –  Alko Feb 15 at 13:04
    
Yes but the idea was that I wouldn't be giving su permission to the program's installer lest it have malintent. –  davly Feb 15 at 15:37

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
    
The installer could envisionably install suid binaries, but that tends to be done for a reason. –  Lars Viklund Feb 19 at 10:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.