Modewise
Menu

File permission reader

Read a file’s permissions as plain sentences.

Paste what ls -l or stat printed. Modewise says who can read, change and run each file, marks the settings that put a site at risk, and writes the chmod that fixes them for you to check.

Read a listing Convert a mode instead

Read in your browser. Modewise never connects to your server and runs nothing.

One line from the example listing below
-rw-rw-rw-  1 deploy deploy     3204 Nov 12 16:40 config.php
-rw-rw-rw-
  1. - type: file
  2. rw- owner (deploy)
  3. rw- group (deploy)
  4. rw- everyone else
  • The owner, deploy, can read and change it.
  • Members of the group deploy can read and change it.
  • Every other account can read and change it.

Fix now Anyone can change this file

Fix now Every account can read a file that usually holds passwords

chmod go-w,o-rwx -- 'config.php' 666 → 640

A whole listing at once

One paste, every file read out.

This is a made-up web folder for an account called deploy, read the way the reader reads yours, with “this is a web folder” ticked and the web server running as nobody. Of its 9 entries, 4 need fixing now, 1 needs a check and 1 is worth a look.

Pasted

total 64
drwxr-x---  6 deploy nobody     4096 Nov 17 09:14 .
-rw-r--r--  1 deploy deploy      412 Nov 17 09:14 .htaccess
-rw-r--r--  1 deploy deploy      286 Nov 12 16:40 .env
-rw-rw-rw-  1 deploy deploy     3204 Nov 12 16:40 config.php
-rwxr-xr-x  1 deploy deploy      405 Nov 12 16:40 index.php
drwxr-xr-x  4 deploy deploy     4096 Nov 12 16:40 assets
drwxrwxrwx  9 deploy deploy     4096 Nov 16 22:51 uploads
-rw-r--r--  1 deploy deploy  8810422 Nov 15 03:00 site-backup.sql.gz
-rwsr-xr-x  1 deploy deploy    17032 Nov 14 11:02 resize-helper

Written for you to check, never run

# Modewise suggestions: 5 changes for 9 entries. Nothing has been run.
# Read each line first, run them from the folder you listed, and never add -R to them.
chmod o-rwx -- '.env'   # 644 -> 640 (Every account can read a file that usually holds passwords)
chmod go-w,o-rwx -- 'config.php'   # 666 -> 640 (Anyone can change this file; Every account can read a file that usually holds passwords)
chmod a-x -- 'index.php'   # 755 -> 644 (Execute right on a web file)
chmod go-w -- 'uploads'   # 777 -> 755 (Full access for everyone (777))
chmod u-s -- 'resize-helper'   # 4755 -> 755 (Runs with its owner's powers (setuid))

A setuid helper and a database copy that nobody remembers leaving can mean the site was broken into: see when to ask for help before changing anything.

Read out

  1. . drwxr-x--- No flags No flags
  2. .htaccess -rw-r--r-- No flags No flags
  3. .env -rw-r--r-- Every account can read a file that usually holds passwords Fix now
  4. config.php -rw-rw-rw- Anyone can change this file · Every account can read a file that usually holds passwords Fix now
  5. index.php -rwxr-xr-x Execute right on a web file Worth a look
  6. assets drwxr-xr-x No flags No flags
  7. uploads drwxrwxrwx Full access for everyone (777) Fix now
  8. site-backup.sql.gz -rw-r--r-- A database copy or backup in the web folder Check
  9. resize-helper -rwsr-xr-x Runs with its owner's powers (setuid) Fix now

Open this example in the reader to see every sentence.

The three columns

Owner, group, everyone else.

Every file has one owner and one group. Linux checks the first class that matches you and uses only that class’s three rights. On a folder the same letters mean different things.

What r, w and x allow on a file and on a folder
LetterOn a fileOn a folder
r readopen and read itsee the names in it
w writechange itcreate, rename or delete files in it (needs x too)
x executerun it as a programgo into it and reach what is inside
  • Owner

    The account that owns the file. It gets the first three letters, even when the others allow more.

  • Group

    Every account in the file’s group, other than the owner, gets the middle three.

  • Everyone else

    Every other account on the server, including other sites on shared hosting and often the web server itself.

What it flags

Each flag comes with its reason.

The rules are written out on the guide, the same words the reader shows. The fixes only ever take rights away; anything that needs more thought gets a note instead of a command.

  • Fix now Full access for everyone (777)
  • Fix now Anyone can change this file
  • Fix now Anyone can add or delete files in this folder
  • Note Shared folder with the sticky bit (like /tmp)
  • Fix now Runs with its owner's powers (setuid)
  • Check Runs with its group's powers (setgid)
  • Note New files here get this folder's group (setgid folder)
  • Worth a look A special bit that has no effect
  • Worth a look Everyone in the group can change it
  • Check Every account can read a file that usually holds passwords

The converter

chmod, umask and chown, worked out.

Numbers and letters

755rwxr-xr-x

644rw-r--r--

2775rwxrwsr-x

1777rwxrwxrwt

A chmod change, applied

644u+x744

755go-rx700

640g=u660

755g+ws2775

On a folder, GNU chmod 755 keeps the setgid bit: 2775 becomes 2755.

What a umask gives new files and folders

umask 022files644folders755

umask 002files664folders775

umask 027files640folders750

umask 077files600folders700

Open the converter

Pricing

Free to read. $1.95 a month to keep notes.

The reader, the flags, the fixes and the converter are free, as often as you like. A Modewise Pass adds room in your Server Notebook and the compare view. Nothing renews by itself: a pass simply ends after its time, and you buy another only if you want one.

Free

$0

  • The reader: paste ls -l, stat or find -ls output and get every file in plain words
  • Risk flags with the reason for each, and the chmod fix written out
  • The converter: octal and letters, chmod changes step by step, umask and chown
  • Everything is read in your browser; nothing you paste is sent or kept
  • A Server Notebook with one saved page of up to 20 entries

Read a listing

Modewise Pass

$1.95 for 31 days or $19.50 for 366 days, two months free

Everything in Free, and for one Server Notebook:

  • Up to 25 pages per Server Notebook, 300 entries each
  • Compare a fresh listing with a saved page: every mode, owner and group that changed, and files added or gone
  • A note on each page for your own server notes (kept until you delete it, or until the Notebook goes 13 months unopened)
  • A CSV of each saved page, which you can still download after a pass ends

Free during preview. Payments are not switched on yet, so every Server Notebook has everything in the Pass, at no charge. When payments start, these prices apply and this box will say so first.

Start a Server Notebook

Nothing you paste leaves the page.

The reader is code in this page. The page tells your browser to refuse every connection a script tries to open, so a listing cannot be sent anywhere, and Modewise has no server-side reader to send it to. Only a page you choose to save in a Server Notebook is stored, and then only each file’s path, type, mode, owner and group.