Access Control

3. Access Control#

This chapter introduces Unix access control: users, groups, permissions, defaults, and bounded permission audits that shape secure command-line work.

  • Identity: Connect users, groups, UIDs, and GIDs to filesystem access decisions.

  • Permissions: Read symbolic and octal permission forms and change them deliberately.

  • Defaults: Use umask to reason about permissions assigned to new files.

  • Privilege: Recognize when elevated access is needed and when it is risky.

  • Permission audits: Compare mode observations with intended policy inside an explicit practice tree.

Chapter Video

How to Modify File Permissions in Bash (9:41) by Microsoft Developer

Hosted on YouTube; property of its original creator, embedded here for educational reference only.

Learning Objectives

By the end of this chapter, you will be able to:

  1. Explain how users, groups, and privileges identify access rights, and create and test a regular and an administrative account on a Linux VM.

  2. Read and change symbolic and octal file permissions.

  3. Predict new-file and new-directory modes using umask, including its limits.

  4. Explain setuid, setgid, and sticky-bit observations without changing system executables.

  5. Audit a student-owned fixture tree and justify targeted permission corrections.

Chapter Flow

Glossary

#

Term

Explanation

1

User

An account identity used to own files and run processes.

2

UID

A numeric user identifier used internally by Unix-like systems.

3

Group

A collection of users that can share file access.

4

GID

A numeric group identifier used internally by the system.

5

Root

The superuser account with administrative privileges.

6

sudo

A command that runs another command with elevated privileges when authorized.

7

Owner

The user account associated with a file or directory.

8

Group owner

The group associated with a file or directory.

9

Permission bits

The read, write, and execute settings stored for a file.

10

Read permission

Permission to inspect file contents or list a directory.

11

Write permission

Permission to modify a file or change entries in a directory.

12

Execute permission

Permission to run a file as a program or traverse a directory.

13

chmod

The command used to change file permissions.

14

chown

The command used to change file ownership.

15

chgrp

The command used to change group ownership.

16

Octal notation

A numeric permission form such as 755 or 644.

17

Symbolic mode

A permission form such as u+x or go-w.

18

umask

A mask that removes permissions from newly created files and directories.

19

Special permissions

Permission bits such as setuid, setgid, and sticky bit.

20

Least privilege

Using only the access needed for an authorized task.

21

Directory search

Permission to resolve a child name through a directory.

22

Permission audit

Comparing observed ownership and modes with an intended access policy.

23

Setuid

A special bit associated with effective user identity on eligible program execution.

24

Setgid

A special bit associated with eligible program group identity or directory group inheritance.

25

Sticky bit

A directory bit restricting entry removal and rename by otherwise permitted users.

26

Regular account

An everyday login account that is not allowed to use sudo.

27

Administrative account

A login account in the administrative group, used only for tasks that need root.

28

adduser

The Debian and Ubuntu command that creates an account, its private group, and its home directory.

29

usermod

The command that changes an existing account, such as appending a group with -aG.

30

getent

A command that looks up accounts and groups in every configured identity source.

Lecture Slides

Access Control slides