How to grant permissions to a regular Linux user?

To grant permission to regular users in a Linux system, you can use the following command:

  1. To add a user: Start by using the adduser or useradd command to create a new user. For example, sudo adduser username.
  2. Create password: Use the passwd command to set a password for a new user. For example, sudo passwd username.
  3. Authorized user: Users can be granted authorization by adding them to the appropriate user group or by directly giving them specific permissions.
  4. Add a user to a user group by using the command usermod -aG groupname username. For example, sudo usermod -aG sudo username adds the user to the sudo group to gain administrator privileges.
  5. Directly authorize users: You can grant a user permission to read and write to a specific directory or file using the chmod command. For example, sudo chmod u+rwx /path/to/directory grants read and write permissions to the directory for the user.
  6. To verify authorization, you can use the command “groups username” to see the user’s groups and “ls -l” to check the permissions of directories or files.

This way, regular users in the Linux system can be successfully authorized.

Leave a Reply 0

Your email address will not be published. Required fields are marked *