Linux Permissions

Read ls output, chmod, chown, and sudo without breaking access.

  • chmod
  • chown
  • linux permissions
  • sudo
  • ssh key permission

Linux Permissions

Read ls output, chmod, chown, and sudo without breaking access.

Commands

CommandWhat it does
ls -lDecode rwxr-xr-x at a glance
chmod 755 script.shStandard for scripts
chmod -R 640 config/Readable, not executable
chown -R app:app /srv/appFix ownership after root copies
sudo !!Re-run last command as root

Example

chmod 600 ~/.ssh/id_ed25519
chown -R app:app /srv/app

FAQ

What do 755 and 644 mean?

Octal triples for owner, group, other: 7 is rwx, 6 is rw, 5 is r-x, 4 is r. Scripts 755, data 644, keys 600.

Permission denied but the file looks fine?

Check parent directory execute bits and ownership - traversal needs execute on every ancestor.

Частые вопросы

What do 755 and 644 mean?
Octal triples for owner, group, other: 7 is rwx, 6 is rw, 5 is r-x, 4 is r. Scripts 755, data 644, keys 600.
Permission denied but the file looks fine?
Check parent directory execute bits and ownership - traversal needs execute on every ancestor.

Linux