I'm somewhat confused about Linux packages and permissions, people often say not to install packages as root. Yet when installing most .deb files via gdebi I'm prompted to enter the root password. Same goes for apt and synaptic.

enter image description here

Are these applications asking for the root password just to be able to place files in the root directories (if so, why not place all installation files in the user directory), or are they actually being installed as root?

When installing an application am I essentially saying “I trust you completely and allow you to do whatever you want to my system” or are there any restrictions when the program runs?

  • Most packages are installed as root. Who are those people? You probably shouldn't pay much attention to what they say. – mikewhatever Mar 3 '17 at 11:28

First off, we are advised to always install from the Ubuntu repos because there are tested. So when you install with sudo from such a repo you can be assured it will only do what is expected of it.

Now that being said make sure you fully trust any repository you are adding to your system as ( based on the need to install certain files to the root location ) apps will need to have root permission to install into sensitive areas of your system.

Now a situation where you are advised not to install a package as root, would probably mean that it's a third party package and it's security isn't assured, and it can be corrupted while on transit to you and with this in turn will lead to the application gaining access to sensitive areas as a result of the root powers given to it via your sudo command. Some packages are even kind enough to prevent you from installing as root in the first place, such apps will enforce such a doctrine of no sudo use (if I may call it that). My advice please take that advice.

Linux uses LSM (Linux Security Modules) to control what accesses what.

LSM Choices:

  • current LSMes are:

    • SMACK
    • TOMOYO

What the LSM does is to ensure that any process is limited to what it can access based on the current security policy governing that system. So give sudo powers to an app is not enough, but care must be taken that you don't sudo powers to the wrong apps as advised above.

  • Once an application is installed using root privilages, does it automatically run as the root user or as a regular user? In other words, when I install a .deb package am I giving the application total permission? – Rtsne42 Mar 3 '17 at 11:50
  • No, there is a security system that limits what any app can do, so giving an app sudo powers isn't enough – George Udosen Mar 3 '17 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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