After a fresh installation of a Fedora distribution, it is recommended by best practices to create a separate user to manage the system. In the case you do need privileged access, Use sudo.This allows for simple auditing and tracking features. It is also best to disable root. We will show how to do these in this tutorial. Let’s start with the syllabus.
- Create user and add them to a specific group.
- Add password to the user.
- Grant sudo access.
- Disable root.
+Open up a terminal.
Add User fox, create group ssh, add user to group ssh:
First, create user fox and then create group ssh. After that is done, add user fox to its secondary group ssh.
groupadd ssh, and
usermod -aG sshd felix.
- Add password to user fox :
Grant sudo access to user fox :
This will grant full sudo access allowing the user to have root privileges everything sudo is ran.
echo "fox ALL=(ALL) ALL" >> /etc/sudoers
Disable root and verify if it has an interactive shell : Disable root by adding a different interactive shell to its user. sudo su will grant root privileges and using it will provide evidence that root is enabled. Command :
usermod -s /bin/nologin root&
If you have any questions on any of this please leave a comment below and I can provide and adjust the blog to your understanding.
“If your hate could be turned into electricity, it would light up the whole world.” ― Nikola Tesla