Linux Basics/User management (System administrator)
Jump to navigation Jump to search
The system administrator (superuser) and its functions[edit | edit source]
- The most important user in Linux is: root
- UID: 0, GID: 0
- Root can access everything in the system!
- The „su” command:
- Changing user and executing command:
- For example, we can become user mary:
- If we use dash, then we get the whole environment of mary:
su - mary
- We can add a group with the sg command. For example, we can add info:
- Sudo command
- With sudo command we can execute superuser commands. It asks the user's password, this is important because we don't want anybody to modify our system.
- Ubuntu-based systems get root permissions only by sudo, root user doesn't get password.
- We don't edit sudo's settings from directly the file. We use the following command instead:
- Settings → in /etc/sudoers file
<username> ALL=NOPASSWD: ALLExample:
joska ALL=NOPASSWD: ALL
- Without NOPASSWD it asks the given user's password.
- Setting superuser permission: