Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/books/admin_guide/04-advanced-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ antoine
steven
```

!!! Note
!!! Note
`uniq` requires the input file to be sorted because it only compares consecutive lines.

Without an argument, the `uniq` command will not display identical lines that follow each other in the `firstnames.txt` file:
Expand Down Expand Up @@ -215,7 +215,7 @@ The `-I` option allows you to specify a character (in our example the `%` charac

The `yum-utils` package is a collection of utilities from different authors for `yum`, which make it easier and more powerful to use.

!!! Note
!!! Note
While `yum` has been replaced by `dnf` in Rocky Linux 8, the package name has remained `yum-utils` although it can be installed as `dnf-utils` as well. These are classic YUM utilities implemented as CLI shims on top of DNF to maintain backwards compatibility with `yum-3`.

Here are some examples of usage:
Expand Down Expand Up @@ -266,7 +266,7 @@ $ repoquery -l yum-utils

The `yumdownloader` command downloads RPM packages from the repositories.

!!! Note
!!! Note
This command is very useful to quickly build a local repository of a few rpm!

Example: `yumdownloader` will download the _repoquery_ rpm package and all its dependencies:
Expand Down Expand Up @@ -326,7 +326,7 @@ The `watch` command regularly executes a command and displays the result in the

The `-n` option allows you to specify the number of seconds between each execution of the command.

!!! Note
!!! Note
To exit the `watch` command, you must type the keys: <kbd>CTRL</kbd>+<kbd>C</kbd> to kill the process.

Examples:
Expand Down
12 changes: 6 additions & 6 deletions docs/books/admin_guide/05-vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ Among these improvements, the user has syntax highlighting, which is very useful

During a session, VI uses a buffer file in which it records all the changes made by the user.

!!! Note
!!! Note
As long as the user has not saved his work, the original file is not modified.

At startup, VI is in *commands* mode.

!!! Tip
!!! Tip
A line of text is ended by pressing <kbd>ENTER</kbd> but if the screen is not wide enough, VI makes automatic line breaks, _wrap_ configuration by default. These line breaks may not be desired, this is the _nowrap_ configuration.

To exit VI, from the Commands mode, tap <kbd>:</kbd> then type:
Expand All @@ -82,7 +82,7 @@ To exit VI, from the Commands mode, tap <kbd>:</kbd> then type:

To force the exit without confirmation, you must add *!* to the previous commands.

!!! Warning
!!! Warning
There is no periodic backup, so you must remember to save your work regularly.

## Operating mode
Expand Down Expand Up @@ -197,7 +197,7 @@ In *command* mode, there are several ways to insert text.

VI switches to *insert* mode after entering one of these keys.

!!! Note
!!! Note
VI switches to *insertion* mode. So you will have to press the <kbd>ESC</kbd> key to return to *command* mode.

### In relation to a character
Expand Down Expand Up @@ -262,7 +262,7 @@ These operations are done in *command* mode.

<kbd>R</kbd><kbd>characters</kbd><kbd>ESC</kbd>

!!! Note
!!! Note
The <kbd>R</kbd> command switches to *replace* mode, which is a kind of *insert* mode.

### Words
Expand All @@ -287,7 +287,7 @@ These operations are done in *command* mode.

<kbd>c</kbd><kbd>w</kbd><kbd>_word_</kbd><kbd>ESC</kbd>

!!! Tip
!!! Tip
It is necessary to position the cursor under the first character of the word to cut (or copy) otherwise VI will cut (or copy) only the part of the word between the cursor and the end.
To delete a word is to cut it. If it is not pasted afterwards, the buffer is emptied and the word is deleted.

Expand Down
46 changes: 23 additions & 23 deletions docs/books/admin_guide/06-users.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Several users can be part of the same group.

Users can belong to other groups. These users are *invited* to these **secondary groups**.

!!! Note
!!! Note
Each user has a primary group and can be invited into one or more secondary groups.

Groups and users are managed by their unique numerical identifiers `GID` and `UID`.
Expand All @@ -41,7 +41,7 @@ Account and group declaration files are located in `/etc`.
* `UID`: _User IDentifier_. Unique user ID.
* `GID`: _Group IDentifier_. Unique group identifier.

!!! Danger
!!! Danger
You should always use the administration commands instead of manually editing the files.

## Group management
Expand Down Expand Up @@ -75,7 +75,7 @@ Group naming rules:
* No accents or special characters;
* Different from the name of an existing user or system files.

!!! Note
!!! Note
Under **Debian**, the administrator should use, except in scripts intended to be portable to all Linux distributions, the `addgroup` and `delgroup` commands as specified in the `man`:

```
Expand Down Expand Up @@ -129,15 +129,15 @@ Example:
$ sudo groupdel GroupC
```

!!! Tip
!!! Tip
To be deleted, a group must no longer contain users.

Deleting the last user of an eponymous group will cause the system to delete the group.

!!! Tip
!!! Tip
Each group has a unique `GID`. A group can be duplicated. By convention, the `GID` of system groups range from 0 (`root`) to 999.

!!! Tip
!!! Tip
Since a user is necessarily part of a group, it is best to create the groups before adding the users. Therefore, a group may not have any members.

### `/etc/group` file
Expand All @@ -155,7 +155,7 @@ GroupP:x:516:patrick
* 3: GID.
* 4: Guest members (separated by commas, does not contain core members).

!!! Note
!!! Note
Each line in the `/etc/group` file corresponds to a group. Users whose group is their main group are not listed at this level. This membership information is in fact already provided by the `/etc/passwd` file...

### `/etc/gshadow` file
Expand All @@ -173,7 +173,7 @@ GroupA:$6$2,9,v...SBn160:alain:rockstar
* 3: Administrator of the group.
* 4: Guest members (separated by commas, does not contain core members).

!!! Warning
!!! Warning
For each line in the `/etc/group` file there must be a corresponding line in the `/etc/gshadow` file.

A `!` in the password indicates that it is locked.
Expand Down Expand Up @@ -238,7 +238,7 @@ Account naming rules:
* Different from the name of an existing group or system file;
* Set the options `-u`, `-g`, `-d` and `-s` at creation.

!!! Warning
!!! Warning
The home directory tree must be created except for the last directory.

The last directory is created by the `useradd` command, which takes the opportunity to copy the files from `/etc/skel` into it.
Expand All @@ -253,7 +253,7 @@ Example:
$ sudo useradd -u 1000 -g GroupA -G GroupP,GroupC albert
```

!!! Note
!!! Note
Under **Debian**, you will have to specify the `-m` option to force the creation of the login directory or set the `CREATE_HOME` variable in the `/etc/login.defs` file. In all cases, the administrator should use the `adduser` and `deluser` commands as specified in the `man`, except in scripts intended to be portable to all Linux distributions:

```
Expand Down Expand Up @@ -314,7 +314,7 @@ Options identical to the `useradd` command.

With the `usermod` command, locking an account results in the addition of `!` before the password in the `/etc/shadow` file.

!!! Tip
!!! Tip
To be modified, a user must be disconnected and have no running processes.

After changing the identifier, the files belonging to the user have an unknown `UID`. It must be reassigned the new `UID`.
Expand Down Expand Up @@ -377,7 +377,7 @@ $ sudo userdel -r carine
| -------| --------------------------------------------------------- |
| `-r` | Deletes the connection directory and the contained files. |

!!! Tip
!!! Tip
To be deleted, a user must be logged out and have no running processes.

`userdel` removes the user's line from the `/etc/passwd` and `/etc/gshadow` files.
Expand Down Expand Up @@ -419,12 +419,12 @@ root:$6$...:15399:0:99999:7:::
* 8: Account expiration time.
* 9: Reserved for future use.

!!! Danger
!!! Danger
For each line in the `/etc/passwd` file there must be a corresponding line in the `/etc/shadow` file.

## File owners

!!! Danger
!!! Danger
All files necessarily belong to one user and one group.

The main group of the user creating the file is, by default, the group that owns the file.
Expand Down Expand Up @@ -491,7 +491,7 @@ $ sudo chgrp group1 file
| `-R` | Modifies the owner groups of the directory and its contents (recursion). |
| `-v` | Displays the executed changes. |

!!! Note
!!! Note
It is possible to apply to a file an owner and an owner group by taking as reference those of another file:

```
Expand Down Expand Up @@ -558,7 +558,7 @@ Example:
[alain]$ newgrp GroupB
```

!!! Note
!!! Note
After using this command, the files will be created with the `GID` of its subgroup.

The command `newgrp` without parameters reassigns the main group.
Expand Down Expand Up @@ -607,7 +607,7 @@ Example:
$ sudo passwd alain
```

!!! Note
!!! Note
The `passwd` command is available to users to change their password (the old password is requested). The administrator can change the passwords of all users without restriction.

They will have to comply with the security restrictions.
Expand All @@ -620,7 +620,7 @@ Example:
```
$ sudo echo "azerty,1" | passwd --stdin philippe
```
!!! Warning
!!! Warning
The password is entered in clear text, `passwd` takes care of encrypting it.

### `chage` command
Expand Down Expand Up @@ -654,7 +654,7 @@ $ sudo chage philippe
$ sudo chage -d 0 philippe
```

!!! Note
!!! Note
If no user is specified, the order will concern the user who enters it.

![User account management with chage](images/chage-timeline.png)
Expand All @@ -666,7 +666,7 @@ Configuration files:
* `/etc/login.defs`
* `/etc/skel`

!!! Note
!!! Note
Editing the `/etc/default/useradd` file is done with the `useradd` command.

The other files are to be modified with a text editor.
Expand All @@ -675,7 +675,7 @@ Configuration files:

This file contains the default data settings.

!!! Tip
!!! Tip
When creating a user, if the options are not specified, the system uses the default values defined in `/etc/default/useradd`.

This file is modified by the command `useradd -D` (`useradd -D` entered without any other option displays the contents of the `/etc/default/useradd` file).
Expand All @@ -690,7 +690,7 @@ This file is modified by the command `useradd -D` (`useradd -D` entered without
| `SKEL` | Skeleton directory of the login directory. |
| `CREATE_MAIL_SPOOL` | Mailbox creation in `/var/spool/mail`. |

!!! Warning
!!! Warning
Without the `-g` option, the `useradd` command creates a group of the user's name name and places it there.

In order for the `useradd` command to retrieve the value of the `GROUP` field from the `/etc/default/useradd` file, you must specify the `-N` option.
Expand Down Expand Up @@ -749,7 +749,7 @@ If the login is not specified, it will be `root`.

Standard users will have to type the password for the new identity.

!!! Tip
!!! Tip
There are successive 'layers' created (a stack of `bash` environments). To switch from one user to another, you must first type the `exit` command to take back your identity and then the `su` command to take another identity.

#### Profile loading
Expand Down
Loading