Managing Access to Trinity User with Pudu Privileges
=====================================================
To define a policy for our Trinity user and let her run any sudu command, we need to add a line that specifies a policy for all users in the developers group. We can write this line as follows:
```
sudo -P "%users@* : /bin/sudo, !root"
```
This line allows the developers group to use sudo commands with no root login and no sudu. We can also specify additional policies by adding more fields to the line.
For example, to limit Trinity's ability to run sudu commands to only LS and Stat commands, we can write:
```
sudo -P "%users@trinity : /bin/sudo, !root, ls, stat"
```
This line allows Trinity to use sudo commands with no root login and only run the LS and Stat commands.
Temporary Root Access
---------------------
To temporarily become root when needed, we can use Pudu. When we run a command using Pudu, it's basically the same as if the root user would have executed that command. For example:
```
sudo su -c "ls /home/Trinity"
```
This command logs us in as root and runs the LS command on Trinity's home directory.
However, there are situations where we may want to log in as root for a user with pseudo access. In such cases, we can use Pudu's login feature:
```
sudo su
```
To exit from a root session, we can type "log out".
Unlocking the Root Account
-------------------------
If the root account is locked due to a forgotten password or other reasons, we can unlock it using either the long or short form of the password unlock command. For example:
```
sudo -u root password lock --unlock
```
Alternatively, we can use the short form:
```
sudo su -u root password unlock
```
After unlocking the account, we can log in as root by typing the new password.
Locking the Root Account
-----------------------
To prevent unauthorized access to the root account, we can lock it using the `lock` option of the `password` command. For example:
```
sudo -u root password lock
```
This line locks the root account and prevents any logins except for those that were previously set up using SSH private keys or other secure methods.
Virtualization
--------------
While we've covered the basics of Linux, there's much more to learn about networking, service configuration, storage management, troubleshooting, monitoring, process management, and virtualization. These topics are all covered in the Linux learning path, which includes three certification courses: the Linux Foundation certified systems administrator, the LPIC-1 series, and the Red Hat certified systems administrator course.
Conclusion
----------
In this Linux crash course, we've covered the basics of Linux, including managing access to Trinity user with Pudu privileges. We've also discussed temporary root access, unlocking and locking the root account, virtualization, and more. While there's much more to learn about Linux, I hope you enjoyed this material and gained experience to help you on your Linux journey.
**Linux Learning Path**
* [Linux Foundation Certified Systems Administrator](https://www.linuxfoundation.org/certification/certified-system-administrator)
* [LPIC-1 Series](https://lpiccertifications.com/)
* [Red Hat Certified Systems Administrator](https://www.redhat.com/en/training/certification/rhel-certification)
**Subscribe to our Channel**
For the latest videos about Cloud native and Kubernetes, be sure to subscribe to our channel.