Command Palette

Search for a command to run...

Back to Blog
LinuxLinuxTerminalBeginnerPermissions

The 2023 Linux Launchpad: Part 3 - The Gatekeeper

January 19, 2023
7 min read
Cover image for The 2023 Linux Launchpad: Part 3 - The Gatekeeper

The Why

Linux is a multi-user operating system. Security is built into every single file. You must act as the Gatekeeper, deciding who gets to see, touch, or run your data.

The Commands

1. cat (Concatenate)

Read a file's content instantly.

zain@linux:~$ cat /etc/hostname
linux-server-01

2. less

Read large files one page at a time. Use arrow keys to scroll, q to quit.

zain@linux:~$ less /var/log/syslog

3. chmod (Change Mode)

Change permissions.

  • r (Read) = 4
  • w (Write) = 2
  • x (Execute) = 1

Example: Give the owner full control (7), and everyone else read-only access (4).

zain@linux:~$ chmod 744 script.sh

4. chown (Change Owner)

Change who owns the file. Required when you move files between users.

zain@linux:~$ sudo chown root:root system-config.conf

5. sudo (SuperUser DO)

The "God Mode" command. Executes the following command with Administrator (root) privileges.

zain@linux:~$ sudo apt update

Try It Yourself

  1. Create a secret file: touch secret.txt.
  2. check its permissions: ls -l secret.txt.
  3. Lock it down so only you can read/write it (no one else): chmod 600 secret.txt.
  4. Verify the change: ls -l secret.txt (Should look like -rw-------).

Want to discuss this further?

I'm always happy to chat about cloud architecture and share experiences.

Follow me for more insights on cloud architecture and DevOps

Follow on LinkedIn