惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
B
Blog RSS Feed
GbyAI
GbyAI
P
Proofpoint News Feed
aimingoo的专栏
aimingoo的专栏
MyScale Blog
MyScale Blog
D
Docker
阮一峰的网络日志
阮一峰的网络日志
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recorded Future
Recorded Future
美团技术团队
The Register - Security
The Register - Security
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美
量子位
B
Blog
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
雷峰网
雷峰网
大猫的无限游戏
大猫的无限游戏
J
Java Code Geeks
L
LangChain Blog
Latest news
Latest news
S
SegmentFault 最新的问题
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Blog — PlanetScale
Blog — PlanetScale
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cisco Talos Blog
Cisco Talos Blog
F
Full Disclosure
C
Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
W
WeLiveSecurity
T
Tenable Blog
T
Tor Project blog

Danb Blog

Cheaper Sodastream Gas with a Big Tank June 2026: What I've Been Working On · Danb Blog Running Snyk On Forgejo/Codeberg Actions · Danb Blog Tuta & Proton: An Open Source Client Does Not Result in an Open Source Service · Danb Blog May 2026: What I've Been Working On · Danb Blog 3D Printing Parts for my Greenhouse, Round 2 · Danb Blog Great Devices: Nexus 7 2013 · Danb Blog R36S Console RetroArch Stuck Menu Issue · Danb Blog April 2026: What I've Been Working On · Danb Blog Basic OpenCode Sandboxing with Docker · Danb Blog Games Played in 2025 · Danb Blog March 2026: What I've Been Working On · Danb Blog Shivam Mathur's "node-docker" Images are Awesome for PHP CI · Danb Blog February 2026: What I've Been Working On · Danb Blog Your BookStackApp project was assigned as a project for my Software Architecture course · Danb Blog My Sovol SV08 3D Printer Setup in 2026 · Danb Blog January 2026: What I've Been Working On · Danb Blog Epson Printer: The administrator password you entered was not recognized · Danb Blog Pressure to Follow Process · Danb Blog Online Shopping Email Notifications · Danb Blog My HomeLab Setup in 2026 · Danb Blog Linux Label Printing with the Phomemo D30 · Danb Blog Reporting to the CMA: Google Android Developer Verification · Danb Blog OPNsense & Dnsmasq: Responding with specific DNS servers · Danb Blog An Impromptu Introduction to ZFS Drive Replacement at 1am · Danb Blog Experience with UK Medical Cannabis for Ankylosing Spondylitis · Danb Blog Copyright Takedown for Linking to the "State of Open Source" Report · Danb Blog No, Gumroad Did Not Become Open Source Today · Danb Blog Scripting Monitors (KDE on Fedora) · Danb Blog Amber flags in Open Source & Self-Hosted Projects · Danb Blog LLMs are Directing Open Source Licensing · Danb Blog Games Played in 2024 · Danb Blog Beware of Poison in the Source · Danb Blog Common Misconceptions of the AGPL · Danb Blog Adapting GitHub action PHPUnit tests for Codeberg/Forgejo · Danb Blog Lessons from the Allotment · Danb Blog Futo, Please don't attempt to create your own Open Source Definition · Danb Blog Material You (Dynamic/Adaptive) Colors in Legacy Android Apps · Danb Blog Scripting Monitors (Gnome & Wayland on Fedora) · Danb Blog Retaining a Greenhouse Roof with 3d Printing · Danb Blog Games Played in 2023 · Danb Blog Lessons From Growing Food Indoors · Danb Blog Why the Distinction Between "Open Source" and "Source Available" is Important · Danb Blog Raspberry Pi Camera Module 3 Timelapse · Danb Blog Removing the Rear Seats on a Volvo C30 · Danb Blog Reporting Google's WEI to the CMA · Danb Blog Controlling Default GRUB Boot Option via USB · Danb Blog Creating a Video Home for FOSS Projects · Danb Blog Paying for Search · Danb Blog My Favourite Static Site Deploy Method · Danb Blog PhpStorm (JetBrains IDE) 2023 Linux Scaling · Danb Blog Synology Hibernation with Active Backup for Business and Tailscale · Danb Blog My 2023 HomeLab Setup · Danb Blog Redefining Open Source via "Commercial Open Source" · Danb Blog Moving to Mastodon · Danb Blog Gaining Sponsors · Danb Blog "This is a Low Maintenance Project" · Danb Blog Upgrading my CPU, Ryzen 2600 to 5800x · Danb Blog Migrating Google Photos to my Personal NAS · Danb Blog Scheduling Proxmox Storage to Reduce Disk Activity · Danb Blog Why the Term "Open Source" is Important · Danb Blog Lessons From Working for Myself (9 Months In) · Danb Blog Misrepresenting Open Source for Business Benefit · Danb Blog Cat Images in WebP · Danb Blog My 2022 Workstation Setup · Danb Blog Leaving my Job to Focus on Open Source (For a bit) · Danb Blog Quickly Getting Placeholder Images With Unsplash Source · Danb Blog A Thanks to Laravel for the LTS Releases · Danb Blog The Power of currentColor · Danb Blog Dealing With Ankylosing Spondylitis Flareups · Danb Blog Hugo Verbose Dates With Suffixes · Danb Blog
A Quick Overview of Unix-Style Permissions · Danb Blog
2020-11-29 · via Danb Blog

This is a copy of an overview I wrote for people that were coming across an laravel-based file permission GitHub issue in the BookStack project. Adding it here as an easier location to reference.

There are other, more extensive & technical breakdowns but this is intended to give a developer a 10 minute run-down of the basics.

Files and folders have 3 main permissions: read, write & execute. Files and folders are also assigned an owner and group.

Reading Permissions

You can run ls -alh in the terminal to show the files and folders with their permissions:

# ls -alh
drwxrwxr-x  5 dan      dan 4.0K May 28 13:58 .
drwxrwxr-x 18 dan      dan 4.0K Jun  9 10:38 ..
-rw-r--r--  1 dan      dan 5.6K Dec 10 18:19 book_default_cover.png
drwxr-xr-x  2 dan      dan 4.0K Jun  9 10:40 dist
-rw-rwxr--  1 www-data dan  11K Oct 26  2016 favicon.ico
-rw-r--r--  1 dan      dan  412 Aug  9  2017 .htaccess

The permissions are on the left, in the first column. The starting d is shown if it’s a directory. Then there are three sets of rwx.

  • The first set of rwx is the permissions for the owner.
  • The second set of rwx is the permissions for the group.
  • The third set of rwx is the permissions for everyone else.

Each of these characters represents read, write or execute. A hyphen (-) is shown instead if the permission is not granted. Note that execute permissions are required on folders to enter them.

The owner assigned to a file/folder can be seen in the third column. The group can be seen in the fourth. In the example above the file favicon.ico is assigned to the group dan and is owned by www-data. The owner www-data has permission to read and write the file. The group dan has permission to read, write, or execute the file. Everyone else can only read the file.

Octal Format

Permissions may also be shown as numbers in an octal format. In the octal format each permission has a number:

  • Read = 4
  • Write = 2
  • Execute = 1
  • No permission = 0

These numbers are summed together into a single digit. For example, Having all permissions will be shown as a 7 or only having Read+Execute permissions will be shown as a 5. These totals are often used in a set of 3 to represent the permissions for the group, owner & everyone else.

In the example command output above, the permissions for favicon.ico could be shown as 674. The .htaccess file permissions could be shown as 644. All permissions granted to everyone would show as 777.

Setting Permissions

There are two main commands for controlling permissions:

  • chmod (Change mode), Used to set permissions.
  • chown (Change ownership), Used to change the owner and group.

For both of these commands using -R will set permissions recursively upon all child files and directories.

chmod usage

# Format:
chmod [OPTIONS] PERMISSONS FILES...

# Example:
# Grant the owner and group 'read+write+execute' permissions
# Give everyone else 'read and execute' permissions
# In the './storage' directory and all files+folders within.
chmod -R 775 ./storage 

chown usage

# Format:
chown [OPTIONS] USER:GROUP

# Example:
# In the './storage' directory and all files+folders within
# Set the owner to be 'dan' and set the group to be 'www-data'
chown -R dan:www-data ./storage 

Common use

For things such as file uploads, you’d generally want these to be both readable and writable by the webserver. The user and group your web server runs as will depend on your system and config. On ubuntu it’s common for apache and nginx to run as www-data, both as the owner and group. In this case, If i wanted to give the webserver permission to upload and serve files within the ./storage directory I might do the following:

# Recursively set myself as the owner and the web server as the assigned group
chown -R dan:www-data ./storage

# Recursively allow myself and the webserver to Read, Write and Execute files & folders
# While allowing everyone else to only Read or Execute
chmod -R 775 ./storage