0

For example, I am using Spotify for linux.

Wouldn't I need to run it in sudo so that it can write its song cache to my file system?

Also, if you run a program from the launcher, does it get sudo by default?

1 Answers1

1

You need to understand what sudo does. Quoting the Wikipedia page :

sudo (/ˈsuːduː/ or /ˈsuːdoʊ/) is a program for Unix-like computer operating systems
that allows users to run programs with the security privileges of another user (normally the superuser, or root

To explain further, it gives your program access to the core, sensitive files of your computer. Let me give you an example.

Try running touch /etc/abc.txt and you will be thrown an Access Denied error message, because the first "/ " in the path says that it is in the root directory and hence normal users cannot access it. To make the above command work, you will need to elevate your privileges and that is exactly what sudo does. Try running the above command with sudo and you can see the file will be successfully created.

Using sudo for everything is NOT a good practice. You should elevate the permission level of any program only if absolutely necessary. If you keep adding sudo to all the programs, there is a high chance that you'll mess up with the core files of your computer. And yes, No programs get root permission by default.

  • So you only need sudo to access the core files, and you don't need it to write anywhere else on your file system? For example I don't run steam in sudo but it's able to write game files to my drive – user3479458 Jan 15 '15 at 05:14
  • Yes, that's right. You don't need sudo for programs to write to your hard disk. click the green tick mark below the vote down button if this helped you. – Sachin S Kamath Jan 15 '15 at 05:19