Guestbook File Permissions

204 2026-08-05 note ♈︎ ♄︎

The guestbook file should be read-only (644) to prevent direct editing.

Users add entries through the add script instead, which logs changes and maintains consistent formatting.

chmod 644 ~/guestbook.txt
chmod 666 ~/guestbook.log
chmod 755 ~/guestbook-add.sh

The log file stays writable so the script can track who added what and when.

This prevents accidental deletion, ensures all entries are attributed, and allows for future content filtering in the script.

See Shell Script CGI Security for why shell scripts need particular care when handling user input.