⌨️chmod
Also known as chmod Command, Change Mode, chmod 755, chmod 600
A command that changes who may read, write or run a file.
Think of it like
Think of it like changing who is on the list for a club. The door stays the same, the list changes.
Example
Emma's private key file is open to everyone, and SSH refuses to use it. She runs chmod 600 on it, and SSH works.
Why it matters
Secret files need tight rights, and scripts need the run right. chmod sets both.
Definition
Example code
console
$ chmod 600 key.txt
$ ls -l key.txt
-rw------- 1 emma emma 3381 Nov 16 14:02 key.txtCommon mistake
Key takeaways
- 14, 2, 1. Read, write and run, added up.
- 2Three digits. Owner, group, then others.
- 3600 for secrets. Only the owner may read it.