Not understanding package installing
I was told on another site that you should never install programs in root. I was then told to install postfix from root, that postfix would take care of itself. I also installed the mixmaster packaged program into an 'adduser mix' user and was told that I should have just done the 'apt-get install mixmaster' from root. Do some or all packages set up their own adduser <name>?
What am I not understanding here? Thanks. |
There are three "roots" in Linux.
"root" is the administrative user, comparable to "administrator" in Windows. / is the "root" directory; if you visualize the file system as a tree, / is the "root" of the tree. /root is a directory under / and is the home directory for the root user. This article should help you understand the Linux file system. Normally, you would not install a program in the root diectory or in the root of the file system, but you would install a program as root, that is, with administrative rights, because the root user has the rights to place all the program's files where they belong. Hope this helps. |
Quote:
There is actually no reason to set up any adduser accounts on a single user machine. Am I clear on this? |
Quote:
It would be wise to set up a user account that has regular user permissions and does not have root privileges. This article will tell you more about permissions on Linux. I'm not suggesting that you learn it, just that you get the general idea. You can then log in as user to do day-to-day stuff with user privileges, which adds a layer of protection, then log in as root or use the su command to do root (that is, configuration) stuff. User might, for example, click on a malicious link which introduces some malware, but the malware will not have the ability to break out into the rest of the computer. Almost no experienced Linux users would suggest that you do day-to-day computing as the root user. Some Linux distros (Ubuntu and many of its derivatives, for example) actually mask the root account (though it's easy to unmask it) and suggest that persons use the sudo command to do root stuff; personally, I think Ubuntu's sudo fetish is just silly, but that's just my two cents. Linux is not hard, but it is different. There is a learning curve. I came to Linux from Windows, just because I had heard about this Linux thing and was curious; now I use Windows only when I must. After nine years, I've reached the conclusion that, ultimately, Linux is much more logical than that other operating system. About dot com has a very good section about Linux. You might want to check it out. |
Quote:
|
root vs. users is a permissions thing. Root has permissions to do "ANYTHING" to your filesystem and computer. A user has "LIMITED" permissions. You basically need root to install most applications. But you should never RUN "most" applications as root.
From a developers perspective you can do basically everything from downloading, extracting, and compiling an application as a user. Up until the point of "make install" which accesses parts of an installation ONLY available to root (or with root permissions aka sudo). You can still run applications compiled by a user without make install. But only that user has the ability since the executable result of the compile has that users permissions. Not quite that simple since you may need to do some $PATH environment stuff to run an application and it's parts, but possible. |
Really good and comprehensible explanations here. Thank very much.
One other question. If I create a user for non-root daily programs to run from, do I login into that user and install programs using: 'sudo apt-get install <program>'? Do I need to set up root privileges for the user account with visudo to install a program while in that user acount? Or should I ever be installing anything from the user account? |
Quote:
If you use sudo, your login will retain root privileges for a set amount of time, often five minutes, during which you will not need to reenter your password. If you use su, you actually become logged in as the other user and must type exit to end the su session. This article gives a pretty good explanation of the differences; I'm going to point you to it, rather than try to duplicate it myself. |
If you add an additional user, it may not be added to the adm and sudo groups by default. Which is needed to have permissions to use sudo effectively in distros like ubuntu or based off of ubuntu.
|
All times are GMT -5. The time now is 04:43 PM. |