Back to commands

Hosting Operations

Read-only, can be slow

Find Release Files Writable Outside the Owner

You need to spot files under a release directory that are writable by group or other users.

Command

find fixtures/perm-audit/releases/2026-06-25 -type f -perm /0022 -printf '%M %u:%g %p\n' | sort

Before you run this

System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.

When not to use it: Do not blindly remove group write from runtime files without checking how the service writes them.

Expected output

A sorted list of release files with group-write or other-write bits.

System impact

Read-only, can be slow. Nothing changes. The command reports files writable outside the owning user.

Scope this to the smallest useful path or service on busy systems.

Recovery / rollback: no state is changed.

When to use it

Use after deploys, restores, packaging changes, or chmod cleanup when release file mutability matters.

When not to use it

Do not blindly remove group write from runtime files without checking how the service writes them.

Explanation-only example

Illustrated output, not a live lab run

This example is intentionally illustrative. It shows the command shape without killing real processes or changing your machine.

demo@lab:~$

$ find sample-files/perm-audit/releases/2026-06-25 -type f -printf '%M %u:%g %p\n' | sort

-rw-r----- root:root sample-files/perm-audit/releases/2026-06-25/config/app.env
-rw-r--r-- root:root sample-files/perm-audit/releases/2026-06-25/config/secret.key
-rw-r--r-- root:root sample-files/perm-audit/releases/2026-06-25/public/index.html
-rw-r--r-- root:root sample-files/perm-audit/releases/2026-06-25/uploads/orphaned-upload.txt
-rw-rw-r-- root:root sample-files/perm-audit/releases/2026-06-25/uploads/customer-export.csv
-rwsr-xr-x root:root sample-files/perm-audit/releases/2026-06-25/bin/escalate-helper
-rwxr-sr-x root:root sample-files/perm-audit/releases/2026-06-25/bin/report-sync
-rwxr-xr-x root:root sample-files/perm-audit/releases/2026-06-25/bin/healthcheck
-rwxr-xr-x root:root sample-files/perm-audit/releases/2026-06-25/config/worker.conf

$ find sample-files/perm-audit/releases/2026-06-25 -type f -perm /0022 -printf '%M %u:%g %p\n' | sort

-rw-rw-r-- root:root sample-files/perm-audit/releases/2026-06-25/uploads/customer-export.csv
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. find fixtures/perm-audit/releases/2026-06-25 -type f -printf '%M %u:%g %p\n' | sort
  2. find fixtures/perm-audit/releases/2026-06-25 -type f -perm /0022 -printf '%M %u:%g %p\n' | sort

next steps

Related commands

Hosting Operations Can be slow

Find Runtime Directories Writable Outside the Owner

Runtime directories often need writes, but the write boundary should be visible.

find fixtures/perm-audit/releases/2026-06-25/storage fixtures/perm-audit/releases/2026-06-25/uploads -type d -perm /0022 -printf '%M %u:%g %p\n' | sort
Hosting Operations Can be slow

Group Writable Files by Owning Group

Group-writable files are not automatically wrong, but the owning group decides the risk.

find fixtures/perm-audit -type f -perm -0020 -printf '%g %M %p\n' | sort
Cybersecurity Triage Can be slow

Find Upload Files Writable Outside the Owner

Uploads are supposed to be writable at the edge, not writable forever by everyone.

find fixtures/perm-audit/releases/2026-06-25/uploads -type f -perm /0022 -printf '%M %u:%g %p\n' | sort
Cybersecurity Triage Can be slow

Find Writable Directories Missing the Sticky Bit

A writable log directory is not the same thing as a safe shared directory.

find fixtures/perm-audit -type d -perm -0002 ! -perm -1000 -printf '%m %u:%g %p\n' | sort
Hosting Operations Can be slow

Audit a Symlink Permission Chain

A symlink can make the path you audited different from the file the app opens.

find fixtures/perm-audit -type l -printf '%p -> %l\n' -exec namei -l {} \;
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • lpic1:103-gnu-unix-commands
  • lpic1:104-filesystems-permissions-fhs
  • lfcs:essential-commands
  • lfcs:operations-deployment
  • lfcs:services-logs
  • lfcs:storage
  • linuxplus:automation-scripting
  • linuxplus:provisional
  • linuxplus:system-management
  • risk:read-only

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.