install a program as a user or install it as a root?
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
install a program as a user or install it as a root?
install a program as a user or install it as a root?
What is the difference between install a program as a user and install it as a root, all differences please and what is the best?
Install as root, using the sudo form of the command.
Most systems will require that you install as root.
If you look at the binary directories, /bin, /sbin, /usr/bin, and /usr/sbin all the programs there are owned by root and have 755 permissions, which is to say that the permissions are read-write-execute for owner, read-execute for group members and the rest of the world. Further, these directories are owned by root and therefore all files in there should also be owned by root.
This is the common method. It is also designed so that if you have multiple users, that they can also use the newly installed program.
Can someone get away with not doing that or altering file ownership to have it not be root? The answer is yes, but it is not advised.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by detr
install a program as a user or install it as a root?
What is the difference between install a program as a user and install it as a root, all differences please and what is the best?
sudo apt-get install vlc or apt-get install vlc?
On Debian and all the Debian-based systems I know of it isn't possible to run "apt-get install vlc" (or install any other program that way) as root. What makes you think that's possible?
Personally, even when I install things by dropping binary files into directories I do so as root and make them owned by root (I do this for Firefox, for example) because that means that the executable cannot be changed by the user running it. Whether that actually matters or it is actually more secure I could not tell you but to my mind executables ought (in the most part) to be owned by root and used by users other than root. There are other reasons for my doing it which I suppose come down to "consistency".
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,479
Rep:
Installing programs requires root permission, as they are installed for all users to use. However, you can install some (not all) programs in your /home directory for your own personal use.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.