Technical - Linux/OS Flashcards
Hard vs Soft/Sym Link (+how to create)
Hard Link:
Definition: Filesystem entry pointing directly to the inode of a file.
Deletion Behavior: No problem
Creation: ln <source></source> <target></target>
Soft/Symbolic Link:
Definition: File system entry that creates a new inode that references the path to the target file.
Deletion Behavior: Broken link
Creation: ln -s <source></source> <target></target>
File Descriptor (Explain stdout, stderr, and stdin)
Definition: An integer that uniquely identifies an open file in a process.
Standard Descriptors:
stdin (0): Standard input.
stdout (1): Standard output.
Process vs Thread
Process:
Definition: An independent program in execution, with its own memory space.
Resource Sharing: None, separate memory space and resources.
Thread:
Definition: A smaller unit of execution within a process.
Resource Sharing: Separate registers and stack, but shares memory space.
Linux Boot Process (BIOS > MBR > GRUB/LILO > Kernel > Init System)
BIOS: Initializes hardware and loads bootloader from MBR (Master boot record).
GRUB/LILO: Bootloader; loads the Linux kernel.
Kernel: Initializes system hardware and mounts the root filesystem.
Init System: Starts user-space processes (e.g., systemd, SysVinit).
Full Disk Encryption LUKS (TPM Integration)**
LUKS: Linux Unified Key Setup; provides full disk encryption.
TPM: Trusted Platform Module; stores encryption keys securely.
Integration: LUKS can be used with TPM to protect encryption keys against tampering.
Secure Boot
Purpose: Ensures that only signed and authorized software is loaded during boot.
Mechanism: Checks digital signatures of bootloaders and kernels to prevent unauthorized modifications.
Inode (How to check inode number and inode usage)
Index Node:
Definition: Data structure containing metadata about a file (e.g., size, permissions), but not file name or contents.
Check: ls -i <file> shows the inode number. df -i shows inode usage.</file>
Zombie Process
Definition: A process that has completed execution but still has an entry in the process table.
Cause: Parent process has not yet read the exit status.
Check: ps aux | grep Z
Iptables vs UFW**
Definition: User-space utility for configuring Linux kernel firewall.
Usage: iptables -A INPUT -p tcp –dport 22 -j ACCEPT (Allow SSH)
DF vs DU
DF: Shows filesystem disk space usage.
Command: df -h
DU: Shows disk usage of files and directories.
Command: du -sh <directory></directory>
SELinux**
Definition: Security-Enhanced Linux; provides mandatory access controls.
Commands:
Check Status: sestatus
Manage Policies: semanage, setenforce
How to check disk space, memory, cpu, and io
Disk Space: df -h
Memory: free -h
CPU: top or htop
IO: iostat (requires sysstat package)
How to check open files (+why significant)
Command: lsof
Significance: Identifies files and sockets opened by processes, useful for troubleshooting and security.
How to check open ports on local system
netstat -tuln
How to scan external system for open ports (+flags)
nmap -p <port-range> <target></target></port-range>