Skip to content
Learn Netverks

Lesson

Step 13/36 36% through track

permissions-bash

File permissions

Last reviewed May 28, 2026 Content v20260528
Track mode
none
Means
Read / quiz
Reading
~1 min
Level
beginner

This lesson

This lesson teaches File permissions: the syntax, patterns, and safety habits you need before advancing in Bash.

Teams still ship File permissions in Bash codebases—skipping it leaves gaps in debugging and code reviews.

You will apply File permissions in contexts like: Server hardening, chmod/chown fixes, and safe script defaults in production.

Read each lesson, copy bash examples into your own terminal, and complete the lesson MCQs—there is no in-browser runner for security reasons.

When you can explain the previous lesson's ideas without copying starter code.

Unix permissions control who can read, write, or execute files. Scripts need the execute bit; secrets should not be world-readable.

Reading permissions

ls -l hello.sh
touch sample.txt
chmod u+x hello.sh
chmod go-w sample.txt
ls -l hello.sh sample.txt

ls -l shows owner/group/other bits (rwx).

Numeric chmod

chmod 755 deploy.sh   # rwxr-xr-x
chmod 600 secret.env  # rw-------

755 is common for scripts; 600 for private config.

Ownership context

You cannot chmod files you do not own unless you use sudo (not covered here). In CI, scripts run as a service user—permissions must allow that user to read inputs and write artifacts.

Important interview questions and answers

  1. Q: What does chmod +x do?
    A: Adds execute permission for the user class you specify (u+x adds user execute).
  2. Q: Why 600 for secrets?
    A: Owner read/write only—others cannot read the file.

Self-check

  1. What does rwx mean for the owner?
  2. Which chmod makes a script executable for everyone?

Tip: Never chmod 777 on deploy scripts—too open for shared servers.

Interview prep

chmod 755 typical use?

Executable script readable by group/other.

Why 600 for secrets?

Owner-only read/write reduces leak risk.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • chmod 755 when?
  • chown need sudo?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump