↑ ↓ select, Enter open, Esc close

Remove write permission for others recursively

Caution: This command changes the system. Understand what it does before you run it.

Adjust the values, the command updates live
user@server
chmod -R o-w /var/www/vhosts/example.com/httpdocs

Uses o-w to remove only the write permission for others, while owner and group permissions stay as they are. Gentler than a blanket reset to 755 and 644, because intentional deviations are preserved. Test the site and uploads afterwards.

Note: If an application relied on write permission for others because PHP runs as a different user, uploads will fail afterwards. The real fix is then the correct owner, not 777.

Also searched as

  • fix 777 permissions
  • remove world writable permission
  • chmod o-w recursive
  • fix insecure permissions in webspace

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.