Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What do I need to setup on a Ubuntu 9.10 server so that a user can build applications of there choice (i.e. ./configure , make && make install) with out the need for sudo/admin privileges.

I just feel its a bit of a security risk having to give a user access to parts of the system they might not need in order to build a app.

share|improve this question
add comment

3 Answers 3

up vote 21 down vote accepted

If your users use

./configure --prefix=/home/user/opt/

Or for cmake projects

cmake -D CMAKE_INSTALL_PREFIX:PATH=/home/user/opt/ ../source/

This will install the program in that prefix (instead of the default /usr/local/) and your users should then be able to run the program like this:

/home/user/opt/bin/program

If you want them to be able to run the programs by simply using the name (without full path) you need add /home/user/opt/bin to the path environment variable, edit the users .profile and add the following line:

export PATH=/home/user/opt/bin:$PATH

Note that programs installed in this way will be private to the specific user, but it's a way to do it

share|improve this answer
    
Other users will be able to use programs installed like this if they supply the full path and the permissions are set appropriately; and it appears that the default umask allows this on my desktop install. –  Alistair Buxton Mar 21 '11 at 3:07
add comment

Users can build applications without sudo rights. The only time you need sudo rights is when you want to install something into the system directories.

./configure and make work always without sudo rights. make install usually needs sudo rights because it will install the application to /usr/local or /usr (sometimes /opt).

However, if you change the prefix for the installation path (i.e. ./configure --prefix=~/usr/local) in a way that the installation will be perform inside the user's home directory tree, no sudo rights are needed for make install.

share|improve this answer
    
I still think that your answer isn't completely backed up. Why do ./configure and make work always without sudo? How should I justify it to someone who keeps executing sudo make install for example? –  Nikos Alexandris Nov 21 '12 at 7:45
add comment

Adding to what txwikinger has said, you might want to check also fakeroot, which gives an opportunity for building .deb packages with dpkg without needing elevated privileges. Of course, installing those will generally need sudo access.

share|improve this answer
add comment

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.