How to Grant Admin Privileges to a User in Linux

Configurare noua (How To)

Situatie

Linux is a multi-user operating system. Linux employs a robust and granular system of permissions, users, and groups to control access to files and resources. Understanding this is useful for understanding to provide permission to the non-admin user.

Solutie

Pasi de urmat

1. Users

  • In Linux, every interaction with an operating system is conducted by the user.
  • Each username has a unique ID and UID associated with the user.

2. Groups

  • In Linux, Group are users who have similar permission in the Linux Operating system.
  • Groups help manage file permissions more efficiently. For example, if several users need access to the same set of files, they can all be added to a common group, and permissions can be set for that group.

3. Permissions

  • In Linux, Files and directories in Linux have associated permissions, which control who can read, write, or execute them.
  • In Linux, Permission typically refer is read ‘r’, write ‘w’, and execute ‘x’ for the owner group, and others.
  • In Linux, Permission is defined by 10 characters. The first character defines ‘ is file or directory’ and others define the permissions. Below is an example of this.

While using Linux Operating. You will face many problems if you are not an admin user of Linux. This problem can be solved by getting admin privileges. Admin has the right to change operating system functionality that non-admin user does not have. Let’s take an example for better understanding.

If we are using the Ubuntu Operating system for this example and we have two users. In this operating system ‘admin‘ and ‘non-admin‘ are the two users. If we try to not install software using a non-admin user. We will get an error

Permission Error Occurred

In Debian, based distros like Ubuntu and Linux Mint. There is a user management tool available in these distros. You can use this tool for adding and removing the user and giving permission to the user. Below is the available demonstration.

Syntax:

sudo usermod -aG sudo username
  • sudo: The command that grants superuser privileges to execute the following command.
  • usermod: A command used to modify user account settings.
  • -aG sudo: Options that instruct usermod to add the user to the “sudo” group.
  • username: Replace with the actual username to which you want to grant sudo access.

Command:

sudo usermod -aG sudo dachman

Tip solutie

Permanent

Voteaza

(0 din 0 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?