You can create a user that has privileges like root
, and it's home directory will fall under /home/username
. Why does root
get its own folder at the top level of the file system? Is this just convention, a security concern, or is there a performance-related reason?
2 Answers
One reason: On many systems, /home
is on a separate partition (or network share) that might fail to mount and it is a good idea to allow root
to login with his usual environment whenever possible.
-
1This is the same reason why most unix systems have /sbin, /sbin and a /usr/bin and /usr/sbin. The first two contain essential binaries to bring the system up and are therefor located on the root filesystem.– HennesJun 13, 2012 at 17:15
-
1@Hennes you repeated
/sbin
twice what did you mean to say? Jun 13, 2012 at 17:34 -
1@jshin47 Same as the second part, without
/usr/
, I would guess./bin/
and/sbin/
.– IzkataJun 13, 2012 at 18:09 -
There is a very good discussion at lists.busybox.net/pipermail/busybox/2010-December/074114.html. I think it may have started as a unique user system (the root user) and after some improvements (don't know if Unix refers to
unique user
of some sort) it may have been necessary to add different users with different configurations that need to reside on some other directory. Just guessing.– licornaJun 13, 2012 at 18:50 -
2@Alberto: Unix is ancient and the recovery abilities of modern systems couldn't even be imagined back in the days. There are many things in a Unix-like system that would certainly be handled differently from todays perspective. Also, what you put into your root folder is entirely up to you.– SvenJun 14, 2012 at 20:24
root's home should be on the partition that the operating system resides on, which by definition is /, so that you can still login as root without issues if, say, another disk partitions are unavailable. /home is sometimes mounted on a separate partition or a separate drive. If this contains the root homedir and is offline, you may encounter difficulties with your login shell. Not a good idea if you're trying to fix things as the root user.
root
user and "admin" users are not normally the same thing at all. An "admin" user (assuming this is what you mean by "privileges likeroot
") is typically just a regular user that is permitted to execute commands asroot
using something likesudo
./root
, because that is where the filesystem standard says it should be. :p pathname.com/fhs/pub/fhs-2.3.html