Back to articles
Linux File Permissions Explained: A Visual Guide to CHMOD (With Calculator)

Linux File Permissions Explained: A Visual Guide to CHMOD (With Calculator)

via Dev.to WebdevImpeccify

Linux file permissions are one of those things that looks cryptic until someone explains it clearly. Let me be that person. What Does chmod 755 Actually Mean? Every file on a Linux system has three sets of permissions: Owner (the user who created it) Group (users in the same group) Others (everyone else) Each set can have three permissions: r = read (value: 4) w = write (value: 2) x = execute (value: 1) The number 755 breaks down as: 7 = 4+2+1 = read + write + execute (owner gets full access) 5 = 4+0+1 = read + execute (group can read and run) 5 = 4+0+1 = read + execute (others can read and run) Common Permission Numbers Number Meaning Use Case 755 rwxr-xr-x Web directories, scripts 644 rw-r--r-- Regular files, HTML 600 rw------- Private keys, secrets 777 rwxrwxrwx Avoid! Totally open 400 r-------- Read-only sensitive files 750 rwxr-x--- Group-restricted scripts Symbolic vs Numeric Mode You can also use symbolic mode: chmod u+x script.sh # Add execute for owner chmod g-w file.txt # Rem

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
2 views

Related Articles