Exercise 2 resolution
In this section, we’ll copy each item from the list of goals, and explain them while using proper syntax highlighting.
1. Downloading the necessary file from this book’s GitHub repository at https://raw.githubusercontent.com/PacktPublishing/Red-Hat-Enterprise-Linux-RHEL-9-Administration/main/chapter-19-exercise2/users.txt
Here’s how to do this:
wget https://raw.githubusercontent.com/PacktPublishing/Red-Hat-Enterprise-Linux-RHEL-9-Administration/main/chapter-19-exercise2/users.txt
2. Using the users.txt file to generate users in the system in an automated way using the values provided, in the following order: username, placeholder, uid, gid, name, home, shell
First, let’s examine the users.txt
file with the following code:
cat users.txt user;x;1000;1000;myuser1;/home/user1; /bin/false john ;x ;1001 ;1001; John; /home/john ;/bin/false doe ;x ;1002 ;1002; Doe; /home/doe ; /bin/sh athena ;x ;1011 ;1011; Athena Jones; ...