Unit 4: File management and security
Operating Systems notes · PTU syllabus (BSIT303/BSBC403)
On this page
Unit summary
Files store data permanently, and security protects the whole system. This unit covers file operations, access methods, directory structures and management, remote file systems, file protection, security environments, unauthorised use, denial of service, access control and authentication, application security, viruses and anti-virus software, and firewalls.
After this unit you can
- Explain file operations, access methods and directory structures
- Explain remote file systems and file protection
- Explain security threats including unauthorised use and denial of service
- Explain access control, authentication, application security, anti-virus and firewalls
PTU syllabus topics
- File operations
- access methods
- directory structures and management
- remote file systems
- file protection
- security environments
- unauthorized use
- denial of service
- access control and authentication
- application security
- viruses and anti-virus
- firewalls
Topic 1
File concept and operations
- File: named collection of related information on secondary storage; attributes — name, type, location, size, protection, timestamps, owner.
- Operations: create, open, read, write, reposition (seek), delete, truncate, close; the OS maintains an open-file table.
Example
File operations: a text editor creates notes.txt, writes text to it, closes it, later opens and reads it, appends new lines, renames it to final.txt and finally deletes an old copy — each step is an operation the OS provides.
Exam tip
File attributes: name, type, location, size, protection, and time and date information.
Topic 2
Access methods
Sequential
Records read in order
Log files, tapes, text processing
Direct (random)
Any block accessed by number
Databases, airline reservations
Indexed
Index points to blocks; search index then access
Large files with key-based look-up
Example
Choosing access: a log file is read sequentially from start to end; a database finds a customer's record directly by its record number; an indexed file looks up a roll number in an index, then jumps straight to the record.
Exam tip
Sequential suits tapes and logs; direct access suits disks and databases; indexed combines both.
Topic 3
Directory structures and management
Single-level
All files in one directory — naming conflicts
Two-level
Separate directory per user
Tree-structured
Hierarchical folders with paths
Acyclic graph
Shared files and subdirectories (links)
General graph
Allows cycles — needs garbage collection
- Operations: search, create, delete, list, rename, traverse; absolute and relative path names.
Example
Tree-structured directories: /home/asha/notes/os.txt and /home/ravi/notes/os.txt can both exist, because they are in different directories. A single-level directory would allow only one file called os.txt.
Exam tip
Compare single-level, two-level, tree, acyclic-graph and general graph structures.
Topic 4
Remote file systems
- Access files on other machines over a network — NFS (Unix/Linux), SMB/CIFS (Windows shares), distributed file systems (HDFS) and cloud storage; client–server model; issues — consistency, caching, failures, security.
Example
Using a remote file system: in a college lab, students' home folders are stored on a server and mounted on every lab computer through NFS or SMB, so a student can log in on any PC and find the same files.
Exam tip
Remote file systems face issues of network failure, consistency and security.
Topic 5
File protection
- Access control lists (ACLs): list of users and their permissions for each file.
- Unix permissions: owner, group, others × read, write, execute (rwxr-xr--; chmod 754).
- Passwords and encryption for sensitive files.
Example
Reading Unix permissions: each digit is the sum of read = 4, write = 2, execute = 1. chmod 754 report.sh gives the owner 7 = rwx (4 + 2 + 1), the group 5 = r-x (4 + 1) and others 4 = r-- — shown as rwxr-xr--. chmod 640 marks.txt gives rw-r-----: the owner can read and write, the group can only read, and others have no access.
Topic 6
Security environment and threats
- Security goals: confidentiality, integrity, availability.
- Unauthorised use: intruders (casual users, insiders, hackers), stolen credentials, privilege escalation, exploitation of software bugs (buffer overflow).
- Denial of service (DoS): making a system or service unavailable by overwhelming it — DDoS uses many compromised machines (botnets).
Example
A threat to each goal: stealing a password file breaks confidentiality; altering marks in a database breaks integrity; a denial-of-service attack that crashes a college website breaks availability.
Exam tip
Link threats to the CIA triad — confidentiality, integrity, availability.
Topic 7
Access control and authentication
- Authentication: passwords (strong, hashed and salted), one-time passwords, smart cards and tokens, biometrics, multi-factor authentication.
- Access control models: discretionary (owner decides), mandatory (system labels), role-based (permissions by role); principle of least privilege.
Discretionary (DAC)
The owner of the resource
You share a document with two classmates and choose who can edit
Mandatory (MAC)
The system, using security labels
A defence file labelled Secret can be opened only by users cleared for Secret
Role-based (RBAC)
The user's role
In a hospital system, nurses see patient charts and billing staff see invoices
Example
Multi-factor authentication: logging in to net banking with a password (something you know) plus an OTP sent to your phone (something you have) is two-factor authentication — a stolen password alone is not enough. A fingerprint on the phone adds a third factor (something you are).
Topic 8
Application security
- Secure coding (input validation, avoiding buffer overflows and injection), patching and updates, sandboxing, code signing, least-privilege execution, logging and monitoring.
Example
A buffer overflow: a C program copies user input into a 20-character array without checking length. An attacker sends 200 characters, overwriting memory and possibly running their own code. Checking input length (e.g. using fgets with a size limit) prevents it.
Exam tip
Validate all input, apply updates promptly and give programs only the privileges they need.
Topic 9
Viruses and anti-virus software
- Malware: virus (attaches to programs), worm (self-replicates across networks), Trojan horse, ransomware, spyware, rootkit, logic bomb.
- Anti-virus: signature-based detection, heuristic and behaviour-based detection, sandboxing, real-time scanning, regular updates.
Exam tip
Distinguish the three most-asked malware types by how they spread: a virus needs a host program and a user to run it; a worm spreads by itself across the network; a Trojan pretends to be useful software and does not replicate.
Example
How antivirus detects malware: signature-based scanning finds a known virus by matching its code pattern; heuristic and behaviour-based scanning catches new malware by spotting suspicious actions, such as a program encrypting many files quickly.
Exam tip
Antivirus methods: signature-based, heuristic, behaviour monitoring and sandboxing.
Topic 10
Firewalls
- Firewall: filters traffic between networks by rules — packet filters, stateful inspection, application-level gateways (proxies); host-based firewalls on computers.
Example
A simple firewall rule set for a college web server: (1) allow incoming traffic on port 443 (HTTPS) from anywhere; (2) allow port 22 (SSH) only from the IT office's IP address; (3) deny everything else. A stateful firewall also lets the replies to the server's own outgoing requests back in, without opening extra ports.
Exam tip
Security answers score well with two principles: least privilege (give each user or program only the access it needs) and defence in depth (several layers — firewall, authentication, patching, anti-virus, backups).
Key terms
- Access method
- Way of reading and writing file records
- ACL
- List of permissions attached to a file
- Denial of service
- Attack making a service unavailable
- Authentication
- Verifying the identity of a user
- Least privilege
- Granting only the access needed
Quick revision
- File attributes and operations; open-file table.
- Sequential, direct, indexed access.
- Single-level, two-level, tree, acyclic, general graph directories; paths.
- NFS, SMB; ACLs and Unix permissions.
- CIA; unauthorised use; DoS and DDoS; authentication and access control; application security; malware and anti-virus; firewalls.
Important exam questions
Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).
Short-answer questions
- Q1.List six file operations.
- Q2.Distinguish sequential and direct access.
- Q3.What is a tree-structured directory?
- Q4.What does chmod 755 mean?
- Q5.What is a DDoS attack?
- Q6.Distinguish a virus and a worm.
Long-answer questions
- Q1.Explain file operations and access methods.
- Q2.Explain directory structures and remote file systems.
- Q3.Explain file protection and access control and authentication.
- Q4.Discuss security threats, application security, anti-virus software and firewalls.
Stuck on this unit?
Message SBS on WhatsApp for help with Operating Systems, or to ask about studying B.Sc IT at Synetic.
