Practice area
LPIC-1 102: Security
Inspect access and exposure safely: users, sudo, permissions, SSH, listeners, firewall state, and encryption workflows.
Linux One Liners is an independent study and practice resource. It is not affiliated with, endorsed by, or approved by LPI, The Linux Foundation, CompTIA, or any certification provider. This site does not provide exam dumps or real exam questions.
Source status
Source status: LPI LPIC-1 overview verified July 3, 2026. Current version 5.0; exams 101-500 and 102-500.
This page paraphrases study areas into command practice. It does not copy official objective text wholesale and is not an exam dump.
Plain-English goal
Practice area: security review, SUID/SGID, password aging, limits, sudo, open ports, SSH, host security, and encryption basics. Exam/domain: 102-500.
read the situation
Command, output, and next step
Command anatomy
getent group sudo wheel admin 2>/dev/null; sudo -l 2>/dev/null || true
getent- the command family
flags- change output shape or scope
target- the file, service, user, mount, or host being inspected
output- evidence you must explain before changing state
Annotated output
Usage: command [OPTION]... TARGET
Try 'command --help' for common flags.
Try 'man command' for full reference.
What to notice
- Usage
- the command shape and expected target
- --help
- quick option reference
- man
- full local manual page when installed
Safe vs unsafe move
Common wrong move
Treating a practice command as a permission to make a broad production change.
Next safe command
command --help
Troubleshooting ladder
- Name the symptom.
- Inspect read-only state.
- Find the owner, service, file, device, mount, or route.
- Read the decisive output field.
- Choose the next narrow command.
- Avoid broad or destructive changes.
- Make the smallest justified change if required.
- Verify and record what changed.
How to get help
- Know the commandUse
command --help, thenman commandfor the full reference. - Know the conceptUse
apropos keywordorman -k keywordto discover command names. - Maybe a shell builtinUse
type command,command -V command, thenhelp command. - Service behaviorUse
systemctl status serviceandjournalctl -u servicebefore restarting. - Package ownershipUse
dpkg -S,rpm -qf, or the distro package tool for the installed file.
Study plan
- Start with read-only exposure review: login shells, privileged groups, sudo grants, recent auth events, open listeners, and suspicious file modes.
- Practice file security from path traversal to ACLs: owner, group, mode, SUID/SGID/sticky bits, loose private keys, and world-writable paths.
- Review SSH client and server basics: keys, known hosts, host keys, authorized_keys modes, password auth, tunnels, and X11 forwarding risk.
- Understand encryption practice at the command line: GnuPG encrypt/sign/verify/revoke concepts and safe handling of private material.
Command labs
Run these in a lab shell or disposable machine first. The point is to explain the output, not just memorize the command.
Review privileged access
getent group sudo wheel admin 2>/dev/null; sudo -l 2>/dev/null || true
Privileged groups and current sudo rights should be inspected before changes.
Annotated output
Usage: command [OPTION]... TARGET
Try 'command --help' for common flags.
Try 'man command' for full reference.
What to notice: Usage, --help, man.
Next safe command: command --help
Find risky file permissions
find /usr /bin /sbin -xdev -perm /6000 -type f -printf '%m %u:%g %p\n' 2>/dev/null | head -40
SUID/SGID files should be listed for review, not automatically changed.
Annotated output
root 524288000 2026-07-03 /var/log/journal/2f/system.journal
www-data 248512000 2026-07-02 /var/log/nginx/access.log
deploy 146800640 2026-07-01 /var/tmp/app-export.tar
What to notice: owner, bytes, date, path.
Next safe command: du -xhd1 /var | sort -h
Inspect SSH key permissions
namei -l ~/.ssh/authorized_keys 2>/dev/null; stat -c '%a %U:%G %n' ~/.ssh ~/.ssh/authorized_keys 2>/dev/null
SSH directory and authorized_keys modes should be tight enough for OpenSSH to accept them.
Annotated output
f: /srv/app/current/.env
drwxr-xr-x root root /
drwxr-xr-x root root srv
drwxr-x--- deploy www-data app
drwxr-x--- deploy www-data current
-rw------- deploy deploy .env
uid=33(www-data) gid=33(www-data) groups=33(www-data)
What to notice: each path segment, mode, owner/group, effective user.
Next safe command: systemctl show nginx -p User -p Group
command families
Commands to practice
findstatchmodchowngetfaclsetfaclsudosupasswdchageulimitsssshssh-keygengpgufwfirewall-cmdiptables
Related drills
Flashcards
Why audit SUID/SGID files instead of removing bits immediately?
Some are required for normal system behavior; changes need context and rollback.
Why do SSH key file modes matter?
OpenSSH can reject keys if directories or key files are too open.
What does sudo -l show?
The commands the current user may run through sudo, if permitted.
What is the difference between signing and encrypting with GnuPG?
Signing proves authorship/integrity; encryption hides content from anyone without the private key.
Quick quiz
Check the reasoning locally in your browser. Answers are not sent anywhere.
visual practice
SSH trust sequence
Follow the two different trust checks SSH performs: host identity first, then user authentication.
Connect
The client opens a TCP connection to the SSH server.
ssh -vv user@host
Host key
The server proves its host identity. The client compares it with known_hosts.
ssh-keygen -F host
User key
The client offers a user key or other allowed authentication method.
ssh -v user@host 2>&1 | grep -i "Offering public key"
Authorization
The server checks authorized_keys, account state, permissions, and sshd policy.
namei -l ~/.ssh/authorized_keys
Session
Only after both trust checks pass does the shell or command session start.
whoami && id