- Open the
/etc/passwdfile in a text editor:
nano /etc/passwd
- Add the following lines at the end of the file:
tom:x:0:0:Tom,,,:/home/tom:/bin/bash bob:x:0:0:Bob,,,:/home/bob:/bin/bash
Make sure to replace /home/tom and /home/bob with the actual home directories for the users, and /bin/bash with the desired shell.
- Save and exit the file.
- Open the
/etc/groupfile in a text editor:
nano /etc/group
- Add
tomandbobto therootgroup. Find the line that starts withrootand addtomandbobseparated by commas:
root:x:0:tom,bob
- Save and exit the file.
- To ensure that the usernames are logged in the log files instead of „root“, you need to configure the system logging. Open the syslog configuration file:
nano /etc/rsyslog.conf
- Find the line that starts with
authpriv.*and add;userto it. It should look like this:
authpriv.*;user.* /var/log/auth.log
This will log user-related authentication messages to /var/log/auth.log.
- Save and exit the file.
- Restart the syslog service to apply the changes:
service rsyslog restart
After completing these steps, the users tom and bob should have full root access, and their usernames will be logged in the appropriate log files when they execute commands.