How to grant or change user permissions in the Linux operating system?
sobes.tech AI
Answer from AI
In Linux, user permissions are managed using the commands chmod, chown, and usermod.
-
chmodchanges the access rights to files and directories (read, write, execute) for the owner, group, and others. Example:chmod 755 file— the owner can read, write, and execute; others can read and execute. -
chownchanges the owner and group of a file or directory. Example:chown user:group file— sets the owner and group. -
usermodmodifies user parameters, including their groups. Example:usermod -aG group user— adds the user to an additional group.
You can also use groups to view user groups and id for detailed information.
For more fine-grained permission control, ACLs (Access Control Lists) are used with the commands setfacl and getfacl.