The home directory is the user's personal directory in the operating system , where his data, settings, etc. are located.
The name and location of the home directory depends on the type of operating system, for example, in Microsoft Windows it is in the Users directory (in Windows XP - Documents and Settings ), and in Linux - in the / home directory and has a name that corresponds to the system user name . For example, C:\Users\Маша for Windows or /home/masha for UNIX systems.
Content
- 1 In various operating systems
- 2 On Unix-like operating systems
- 2.1 Example
- 2.2 / root
- 3 notes
- 4 See also
On various operating systems
| System | Way | Variable |
|---|---|---|
| Microsoft Windows NT | <root> \ WINNT \ Profiles \ <username> | % UserProfile% |
| Microsoft Windows 2000, XP and 2003 | <root> \ Documents and Settings \ <username> | |
| Microsoft Windows Vista and 7 | <root> \ Users \ <username> | |
| Unix-Based [1] | <root> / home / <username> | $ HOME and ~ / |
| Unix-derived | / var / users / <username> / u01 / <username> / usr / <username> / user / <username> / users / <username> | |
| SunOS / Solaris | / export / home / <username> | |
| Linux ( FHS ) | / home / <username> | |
| AT&T Unix (original version) | <root> / usr / <username> | $ HOME |
| Mac OS X | / Users / <username> | $ HOME and ~ /, and the path to the home directory (in AppleScript) |
| Openvms | <device>: [<username>] | SYS $ LOGIN |
On Unix-like operating systems
In Unix-like operating systems, by default, the user's home directories are located in the / home directory (from the English home - home, home ). Home directories store documents and user settings. Separation into system (for example, / etc , / bin ) and user directories is necessary mainly for simplification of backup and security.
User home directories are defined in the / etc / passwd file . Example:
nataly: x: 1001: 1001 :: / home / nataly: / bin / bash
In this example, user nataly is assigned the home directory / home / nataly .
The structure inside the / home directory may be different. For example, if there are many home directories stored on the server, then it makes sense to place them in subdirectories of the first letter of the username ( / home / n / nataly ).
The / home directory is conveniently located on a separate partition of the hard drive when several Unix-like operating systems are installed on the computer; in this case, each OS mounts this partition in / home .
Ubuntu and some other Linux distributions offer encryption options for home directories (using Ecryptfs ), including during the installation process [2] .
Example
ml @ lantern / home $ ls -l total 8 drwxr-xr-x 26 nataly nataly 872 2008-08-06 21:22 nataly drwxr-xr-x 148 ml ml 7224 2008-08-29 12:13 ml
As you can see from the example, this / home contains two home directories of two different users - ml and nataly . Moreover, each of these directories has a corresponding user identifier (UID) and group identifier (GID). This means that ml cannot get into the nataly home directory and vice versa. Unless the mode ( chmod ) is installed on the directory, which allows everyone to read, not just the owner and group.
/ root
The root directory of the superuser is in /root , not in /home/root . This was done to increase the reliability of the system: in the vast majority of cases, the /home directory is on a separate disk, if its file system is damaged, logging in and restoring it will be very difficult. The root account is used to administer the system, so /root usually located on the same partition as the system (the root user home directory usually does not contain valuable personal files).
Notes
- ↑ “Home Directory Definition”
- ↑ Jang, M. Security Strategies in Linux Platforms and Applications. - Jones & Bartlett Learning, 2010 .-- P. 127-128. - ISBN 9780763791896 .
See also
- Catalog