Every file and directory on a Linux system carries a permission mode made of three permission classes — owner, group, and other — each expressed as a string of read (r), write (w), and execute (x) bits. The familiar rwxr-xr--, for example, breaks down as read, write, and execute for the owner (value 7), read and execute for the group (value 5), and read only for everyone else (value 4). Because each class is independent, the same string can also be written as the octal number 754. The same conversion works in reverse: 644 maps to rw-r--r--, 755 to rwxr-xr-x, 600 to rw-------, and 700 to rwx------. The 700 and 600 patterns are commonly applied to private SSH material because SSH itself refuses to use a key inside a directory or with permissions that any other user can reach. To retrieve a numeric mode in a script-friendly form, stat -c '%a %U %G %n' file prints the octal mode alongside owner, group, and filename.
The first character of an ls -l line conveys the file type rather than a permission: d marks a directory, l a symbolic link, - a regular file, c or b a character or block device, and s or p a socket or named pipe. A file whose owner field reads as user 0 is owned by root, which is why many privileged system utilities are installed as root-owned setuid binaries. Symlinks deserve special attention: their permission string is always reported as 777, because permission checks are performed on the target of the link, not on the link itself. This is also why ./script can return "Permission denied" even when the script is plainly visible and readable to the user — running a program requires the execute bit, which is set with chmod +x script, or with the more explicit chmod u+x script to add it only for the owner.
When new files and directories are created, their initial mode is determined by combining a base value with the process's umask using a bitwise AND of the complement. Files start with a base of 666 (no execute bit) and directories with 777. A typical Ubuntu desktop runs with a umask of 022, yielding 644 for new files and 755 for new directories. Tightening the umask to 077 produces 600 and 700, ensuring that nothing is visible to other users. Loosening it to 002 gives 664 for files, which is useful when working inside a shared group where collaborators are expected to edit each other's files.