← Linux & the Command Line tutorial

Linux & the Command Line

Permissions

Every file has read/write/execute permissions for its owner, its group, and everyone else. ls -l shows them as a string like -rwxr--r--.

Example: making a script executable

$ chmod 755 deploy.sh
$ chown ada:ada deploy.sh
$ ls -l deploy.sh

chmod 755 sets permissions using three digits, owner (7 = read+write+execute), group (5 = read+execute), everyone else (5 = read+execute). chown ada:ada changes who owns the file. Misconfigured permissions are a genuine, common source of real security vulnerabilities, a config file containing secrets that's readable by "everyone" when it should only be readable by its owner is a classic, easily-overlooked mistake, and exactly the kind of thing a security assessment specifically checks for.

Example
$ chmod 755 deploy.sh
$ chown ada:ada deploy.sh
$ ls -l deploy.sh
Output
-rwxr-xr-x 1 ada ada 128 Aug 10 12:00 deploy.sh
Ready to go further?

These free tutorials are a preview, our Cybersecurity cohort covers it in depth, with a real project and a cohort alongside you. Closes Nov 30

Enroll in Cybersecurity

Cookie preferences

Choose what you're comfortable with. You can change this any time from the footer.

Don't miss out

Ready to build something real?

Create a free account to enroll in a track, and get notified the moment a cohort opens.

Create free account