LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-24-2014, 07:14 PM   #1
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Rep: Reputation: 5
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.
 
Old 04-24-2014, 08:41 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,340
Blog Entries: 12

Rep: Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730
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.
 
1 members found this post helpful.
Old 04-24-2014, 08:59 PM   #3
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by frankbell View Post
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.
The three root explanation and reference page seems to explain it to me. So the advise to not install anything in root is referring to the root directory. Doing an "apt-get install mixmaster" then is not going to install it in the /root directory. I thought that if my screen was showing 'root@me:~#', that doing an 'apt-get install <pgm>' at that prompt was going to install <pgm> in directory /root.

There is actually no reason to set up any adduser accounts on a single user machine. Am I clear on this?

Last edited by battles; 04-24-2014 at 09:00 PM.
 
Old 04-24-2014, 10:21 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,340
Blog Entries: 12

Rep: Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730
Quote:
Doing an "apt-get install mixmaster" then is not going to install it in the /root directory
Correct. That command would install everything to where it is supposed to be, using the authority of the root user.

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.

Last edited by frankbell; 04-24-2014 at 10:29 PM.
 
Old 04-25-2014, 12:48 AM   #5
ndc85430
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
Quote:
Originally Posted by battles View Post
There is actually no reason to set up any adduser accounts on a single user machine. Am I clear on this?
"adduser" is a command to add users to the system. They are just "user accounts", not "adduser accounts". You should always have a non-root user account for daily use and only use the root account when required (for, e.g. installing software as detailed above). One reason is that if you're not careful, you can screw up your system. By having a user account, you avoid this problem as you don't have permissions to modify system files. Of course, you do need to be careful when using the root account, but by minimising its use, you minimise the possibility of accidents.
 
Old 04-25-2014, 01:00 AM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,321
Blog Entries: 1

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
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.
 
Old 04-25-2014, 07:03 AM   #7
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
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?

Last edited by battles; 04-25-2014 at 07:29 AM.
 
Old 04-25-2014, 09:11 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,340
Blog Entries: 12

Rep: Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730
Quote:
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>'?
If the distro you are using has sudo configured, yes. If it does not, you will get an error message. Some distros enable sudo out of the box (famously, Ubuntu and its derivatives). Others do not (Slackware, for example; as for Debian, I've had it installed on this machine so long I can't remember, but, at the time of Debian 5.0, I don't think it did), but those distros tend to allow the su command by default.

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.
 
Old 04-26-2014, 12:39 AM   #9
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,321
Blog Entries: 1

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File conflict with the old installed rpm package while installing new package sr164w Linux - Newbie 3 12-15-2011 12:43 PM
[SOLVED] understanding Debian package tools?? since1992trying Linux - General 6 08-16-2010 10:04 PM
Understanding package managers TheStarLion Linux - Software 14 01-03-2010 05:10 PM
Understanding linux package building and user permissions MOPAULY Linux - Newbie 5 01-24-2006 12:39 PM
installing an unstable package from debian's online package archive ganninu Debian 13 11-07-2003 04:00 PM


All times are GMT -5. The time now is 06:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration