0% found this document useful (0 votes)
4 views

User Accounts and Permissions in Linux Mastering Access Control

Uploaded by

dvdsenthil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

User Accounts and Permissions in Linux Mastering Access Control

Uploaded by

dvdsenthil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

User Accounts and Permissions in Linux: Mastering

Access Control
medium.com/@kc_clintone/user-accounts-and-permissions-in-linux-mastering-access-control-677587e3ae82

kc-clintone December 1, 2023

kc-clintone

User accounts and permissions are the bedrock of security and access control in Linux.
Understanding how they work is essential for both system administrators and everyday
users. In this guide, we’ll delve into the concepts of user accounts, user permissions, and
groups in Linux. We’ll show you how to create and manage user accounts and how to grant
or restrict permissions effectively.

User Accounts in Linux


In Linux, a user account is your digital identity. It defines who you are and what you can do
on the system. Here’s a snapshot of how user accounts work:

🔑 Authentication: To access a Linux system, you need a username and password. This is
your first line of defense against unauthorized access.

📦 Ownership: Every file and directory on your system has an owner, typically associated
with a user account. The owner has specific rights to access and modify those files.

1/3
🔐 Permissions: User accounts are assigned permissions that dictate what actions they can
perform on files and directories. These permissions include read (r), write (w), and execute
(x).

User Permissions and Groups

User permissions in Linux determine what actions a user can perform on files and
directories. There are three basic permission levels:

(r): Allows viewing the contents of a file or listing the contents of a directory.
(w): Permits modifying the contents of a file or adding/removing files in a directory.
(x): Grants the ability to run a file or enter and execute files within a directory.

👥
Groups in Linux are collections of users with similar permissions. They allow you to assign
common access levels to multiple users, simplifying access management. Each user is
typically a member of one or more groups.

🔐
Each file and directory has permissions for three categories: owner, group, and others. This
structure allows fine-grained control over who can do what.

Creating and Managing User Accounts

To create a user account, you can use the `useradd` command followed by the username.

Example:

sudo useradd newuser

To set a password for the newly created user, use the `passwd` command.

Example:

sudo passwd newuser

To delete a user account, use the `userdel` command with the -r option to remove the user's
home directory.

Example:

sudo userdel -r username

Granting and Restricting Permissions

2/3
To change the ownership of a file or directory, use the `chown` command. The syntax is
`chown new_owner:group filename`.

Example (change owner and group of a file):

sudo chown newowner:newgroup filename

To change file permissions, you can use the `chmod` command as discussed in Part 6.
Remember to use the `sudo` command to change permissions for files you don't own.

Example (grant read and write permission to the file):

sudo chmod +rw filename

🔗 Additional Resources
For in-depth information, check out the official Ubuntu documentation on adding users and
the Ubuntu permissions documentation on file permissions.

Conclusion
User accounts and permissions are pivotal in Linux for managing access to files and
resources. By understanding how to create and manage user accounts and how to grant or
restrict permissions effectively, you can maintain a secure and well-organized Linux system.

In the next chapters, we’ll explore more advanced topics in Linux administration, including
user privilege management and user roles. Until then, practice these basics to become
proficient in user accounts and permissions.

3/3

You might also like