From ef9052b8d7e15b23160fa86d58cdb8b00886f45a Mon Sep 17 00:00:00 2001 From: Aneta Šteflová Date: Aug 30 2017 20:13:14 +0000 Subject: Add ref mod: What happens when a user is created Adapted from https://bex.fedorapeople.org/fedora-docs-web/rawhide/system-administrators-guide/basic-system-configuration/Managing_Users_and_Groups.html --- diff --git a/en-US/sysadmin_user_stories/assembly-adding_new_user_accounts.adoc b/en-US/sysadmin_user_stories/assembly-adding_new_user_accounts.adoc index 3137c9e..30ddd64 100644 --- a/en-US/sysadmin_user_stories/assembly-adding_new_user_accounts.adoc +++ b/en-US/sysadmin_user_stories/assembly-adding_new_user_accounts.adoc @@ -10,10 +10,10 @@ include::concept-what_is_a_user.adoc[leveloffset=+1] include::concept-what_is_a_group.adoc[leveloffset=+1] -include::concept-what_happens_when_a_new_user_is_created.adoc[leveloffset=+1] - include::procedure-useradd.adoc[leveloffset=+1] +include::reference-what_happens_when_a_user_is_created.adoc[leveloffset=+1] + // include::procedure-creating_a_user_group.adoc[leveloffset=+1] // include::procedure-adding_users_to_user_groups.adoc[leveloffset=+1] diff --git a/en-US/sysadmin_user_stories/concept-what_happens_when_a_new_user_is_created.adoc b/en-US/sysadmin_user_stories/concept-what_happens_when_a_new_user_is_created.adoc deleted file mode 100644 index 93ac6bc..0000000 --- a/en-US/sysadmin_user_stories/concept-what_happens_when_a_new_user_is_created.adoc +++ /dev/null @@ -1,22 +0,0 @@ -// Include an 'ID' that corresponds to the title of the assembly -// The ID will be used as an anchor for linking to the title -// Do not change the ID to make sure existing links keep working -[#{assembly}-concept_template_and_guidelines] -= Concept Template and Guidelines - -_In the title, include nouns that are used in the body text -- this helps readers and search engines find information quickly._ - -// Ideally, base the name of the file on the title to avoid confusion -// Use a consistent system for filenames and IDs, e.g.: -// * Only substitute spaces with underscores -// * Don't use any CAPS - -A concept module describes and explains things such as a product, subsystem, or feature -- what a user needs to understand to do a procedure. A concept module may also explain how things relate and interact with other things. The use of graphics and diagrams can speed up understanding of a concept. - -* Look at nouns and noun phrases in related procedure modules and user story assemblies to find the concepts to explain to users. - -* A concept module in product documentation should explain only things that are visible to users. - -* If a product concept is interesting, but not visible to users, the concept probably does not require explanation in a concept module. - -* A concept module should NOT include numbered steps or other wording that instructs a user to execute a command or perform an action. Instead, put that information in a separate procedure module or user story assembly. diff --git a/en-US/sysadmin_user_stories/reference-what_happens_when_a_user_is_created.adoc b/en-US/sysadmin_user_stories/reference-what_happens_when_a_user_is_created.adoc new file mode 100644 index 0000000..5e4742b --- /dev/null +++ b/en-US/sysadmin_user_stories/reference-what_happens_when_a_user_is_created.adoc @@ -0,0 +1,195 @@ +// Include an 'ID' that corresponds to the title of the assembly +// The ID will be used as an anchor for linking to the title +// Do not change the ID to make sure existing links keep working +[#{assembly}-reference-what-happens-when-a-user-is-created] += What Happens When a User Is Created + +This section explains the process that starts when you issue the [command]#useradd juan# on a system that has shadow passwords enabled. + +. A new line for `juan` is created in `/etc/passwd`: + ++ + +[subs="quotes"] + +---- + +juan:x:1001:1001::/home/juan:/bin/bash + +---- + ++ + +The line has the following characteristics: + ++ + +** It begins with the user name `juan`. + ++ + +** There is an `x` for the password field indicating that the system is using shadow passwords. + ++ + +** A UID greater than 999 is created. Under {MAJOROS}, UIDs below 1000 are reserved for system use and should not be assigned to users. + ++ + +** A GID greater than 999 is created. Under {MAJOROS}, GIDs below 1000 are reserved for system use and should not be assigned to users. + ++ + +** The optional _GECOS_ information is left blank. The GECOS field can be used to provide additional information about the user, such as their full name or phone number. + ++ + +** The home directory for `juan` is set to `/home/juan/`. + ++ + +** The default shell is set to [command]#/bin/bash#. + +. A new line for `juan` is created in `/etc/shadow`: + ++ + +[subs="quotes"] + +---- + +juan:!!:14798:0:99999:7::: + +---- + ++ + +The line has the following characteristics: + ++ + +** It begins with the username `juan`. + ++ + +** Two exclamation marks (`!!`) appear in the password field of the `/etc/shadow` file, which locks the account. + ++ + +.Note + +[NOTE] + +==== + +If an encrypted password is passed using the [option]`-p` flag, it is placed in the `/etc/shadow` file on the new line for the user. + +==== + ++ + +** The password is set to never expire. + +. A new line for a group named `juan` is created in `/etc/group`: + ++ + +[subs="quotes"] + +---- + +juan:x:1001: + +---- + ++ + +A group with the same name as a user is called a _user private group_. For more information on user private groups, see xref:Managing_Users_and_Groups.adoc#s2-users-groups-private-groups[User Private Groups]. + ++ + +The line created in `/etc/group` has the following characteristics: + ++ + +** It begins with the group name `juan`. + ++ + +** An `x` appears in the password field indicating that the system is using shadow group passwords. + ++ + +** The GID matches the one listed for `juan`pass:attributes[{blank}]'s primary group in `/etc/passwd`. + +. A new line for a group named `juan` is created in `/etc/gshadow`: + ++ + +[subs="quotes"] + +---- + +juan:!:: + +---- + ++ + +The line has the following characteristics: + ++ + +** It begins with the group name `juan`. + ++ + +** An exclamation mark (`!`) appears in the password field of the `/etc/gshadow` file, which locks the group. + ++ + +** All other fields are blank. + +. A directory for user `juan` is created in the `/home/` directory: + ++ + +[subs="attributes"] + +---- + +~]#{nbsp}ls -ld /home/juan + +drwx------. 4 juan juan 4096 Mar 3 18:23 /home/juan + +---- + ++ + +This directory is owned by user `juan` and group `juan`. It has _read_, _write_, and _execute_ privileges *only* for the user `juan`. All other permissions are denied. + +. The files within the `/etc/skel/` directory (which contain default user settings) are copied into the new `/home/juan/` directory. The contents of `/etc/skel/` may vary depending on installed applications: + ++ + +---- + +~]# ls -la /home/juan + +total 24 + +drwx------. 4 juan juan 4096 Mar 3 18:23 . + +drwxr-xr-x. 5 root root 4096 Mar 3 18:23 .. + +-rw-r--r--. 1 juan juan 18 Jul 09 08:43 .bash_logout + +-rw-r--r--. 1 juan juan 176 Jul 09 08:43 .bash_profile + +-rw-r--r--. 1 juan juan 124 Jul 09 08:43 .bashrc + +drwxr-xr-x. 4 juan juan 4096 Jul 09 08:43 .mozilla + +---- + +At this point, a locked account called `juan` exists on the system. To activate it, the administrator must next assign a password to the account using the [command]#passwd# command and, optionally, set password aging guidelines.