file permissions

Rules on each file saying which user and group own it and who may read, write or run it.

In more detail

On Linux every file has an owner, a group and read, write and execute permissions for the owner, the group and everyone else. They are often written in octal: 0644 lets everyone read and only the owner write, and 0755 also lets everyone run or enter it.

Examples

mode: "0755" in the file module; quote modes in YAML so the leading zero is kept.
An inventory script needs the executable permission (chmod +x) before Ansible will run it.
os.WriteFile("probe.conf", conf, 0o600)
Linux compares the process's UID and groups with the file's numeric owner and group, then applies the matching class of mode bits. Ownership and mode must be reviewed together: a correct bit pattern on the wrong group still grants the wrong people access. chmod changes the mode and chown changes the owner.
os.open(path, os.O_CREAT | os.O_WRONLY, 0o600): owner may read and write, group and other get nothing

Related terms

Taught in

References

Certification courses