CompTIA Linux+ (XK0-006) flashcards
188 free flashcards. Tap a card to flip it.
useradd Options
Flip cardThe `useradd` command is used to create new user accounts on a Linux system, with various options to configure user attributes.
- `-d` specifies the home directory.
- `-g` sets the primary group.
- `-s` sets the login shell.
- `-M` prevents the creation of the home directory.
Memory trick: USERADD: Don't Make My SHell Go Home!
Umask Calculation for Directories
Flip cardThe `umask` (user file-creation mode mask) determines the default permissions for newly created files and directories.
- For directories, base permissions are usually `777` (rwxrwxrwx).
- The `umask` bits are 'subtracted' from the base permissions (more accurately, the inverse of the umask is ANDed with the base permissions).
- The first digit of umask (often 0) usually represents special permissions, not affecting base rwx.
Memory trick: UMASK: Subtract from 777 (dirs) or 666 (files), then check the math!
Creating Non-Interactive Service Users
Flip cardTo create a non-interactive service user, use `useradd` with options to make it a system user, assign a non-login shell, and prevent home directory creation.
- `-r` for system user (low UID, no expiration).
- `-s /sbin/nologin` or `/bin/false` to prevent interactive shell.
- `-M` to prevent home directory creation.
Memory trick: Service users are 'Restricted', 'Silent', 'Muted'.
systemd Timer OnCalendar and Persistence
Flip card`OnCalendar` defines specific calendar events for timer activation, and `Persistent=true` ensures missed runs are executed after reboot.
- `OnCalendar` uses calendar event specifications (e.g., `*-*-* 02:00:00`).
- `Persistent=true` handles missed timer events after system downtime.
- Timer units activate corresponding service units.
Memory trick: Calendar for 'When', Persistent for 'Missed'.
Setting ACLs for Specific Users
Flip cardAccess Control Lists (ACLs) allow granular permission management beyond traditional `rwx` bits. `setfacl -m u:<user>:<permissions> <file>` grants specific permissions to a user.
- ACLs override or supplement traditional `rwx` permissions.
- `setfacl -m` modifies an existing ACL or adds a new one.
- `u:` prefix specifies a user, `g:` for a group.
Memory trick: Permissions are 'R'ead, 'W'rite, 'X'ecute, 'A'CLs are 'M'ore.
CI/CD Publish/Release Stage
Flip cardThe phase in a CI/CD pipeline where validated build artifacts are stored in a central repository, making them available for deployment.
- Occurs after successful build and testing.
- Artifacts (e.g., Docker images, JARs, packages) are pushed to artifact repositories.
- Artifacts are often tagged with version numbers or commit hashes.
- Aims to create a stable, retrievable version of the software for deployment.
Memory trick: Code, Build, Test, Publish, Deploy: The CI/CD journey, step by step.
journalctl for Service Troubleshooting
Flip card`journalctl` is used to query and display messages from the `systemd` journal. It's essential for diagnosing service issues.
- `-u <unit>` filters by specific `systemd` unit.
- `--since` and `--until` filter by time.
- Useful for seeing service output and errors.
Memory trick: JOURNAL the UNIT's recent past to find the problem!
/etc/shadow Fields
Flip cardThe `/etc/shadow` file stores secure user account information, including password hashes and password aging policies, with each field separated by a colon.
- Contains 9 fields, though not all are always used.
- Fields 3-7 define password aging policies.
- Only accessible by root.
Memory trick: SHADOW's secrets: User, Hash, Last, Min, MAX, Warn, Inactive, Expire, Reserved.