File permissions, users, groups

More learning about linux!!!

Ownership

Permissions

There are three types of permission bits: read, write, execute.

There are three sets of these bits:

In ls -l (or namei) output, the user’s permissions are written first, then the group, then others’.

Change ownership with chmod. Kind of an involved command

Octal digits to know:

Octal triplets to know:

A secret, funnier triplet

Composed of the setuid, setgid, and sticky bits

Rarely needed

solving my problem

The problem is that when I rsync files from my computer to my server, i need to chown them back to be owned by www-data

I had some stuff here but I was totally wrong. In reality: on Termux the files only had permission bits 700, and since rsync -a implies -p which copies permission bits, they were ending up on the server with bits 600. Changing the owning user to www-data allowed the server to read the files.

When i rsynced from my computer it’d set the bits to 775.

Solution: Well, I don’t need to copy those bits in the first place.

while i’m here

“archive mode is -rlptgoD

ok so maybe i just want rsync -r since i don’t need to copy that stuff in the first place?