Permissions only tell half the story; the other half is who owns a file. Ownership is changed with chown user:group path, optionally with -R to descend into subtrees, and with chgrp -R group path when only the group needs adjustment. By design, only root can transfer a file to a new owner — a regular user cannot give away a file they own, which prevents users from handing troublesome material to another account. Inside recursive operations, chown -R changes the ownership of symlinks themselves rather than their targets; the -h flag is added when an operation should affect the symlink directly rather than what it points to.
Standard patterns emerge quickly when restoring a directory tree to a clean state. The canonical recipe sets 755 on every directory and 644 on every file by walking the tree twice with find, once per type, and invoking chmod on each match: find dir -type d -exec chmod 755 {} + followed by find dir -type f -exec chmod 644 {} +. The same find … -exec chmod … {} + idiom is used when resetting ownership after a deploy or restore. When copying permissions from a reference file, chmod --reference=src dst saves the trouble of computing octal values by hand. Typical ownership patterns for an Apache web root set directories to 755 owned by the deployer with group www-data, files to 644, and writable upload directories to 775 or 770 owned by www-data itself.
Creating a file with a known mode from the start is sometimes preferable to editing it after the fact. The install command is built for this: install -m 600 src dst copies a file while applying a chosen mode, owner, and group in one step, sparing the user from a separate chmod. Personal scripts that live in ~/.local/bin generally need 755 to be runnable as commands, while a private utility is sometimes locked down to 700 — the rule is simply that the execute bit must be set for whichever user is meant to invoke the file. Together, chown, chmod, and install form the daily toolkit of permission administration on Linux.