How Unix permissions work
On Linux, macOS and other Unix-like systems, every file and folder has three sets of permissions: for the owner, for the owner’s group, and for everyone else. Each set has three switches: read (r), write (w) and execute (x). For a folder, execute means you may open it and use what is inside. The chmod command changes them, and it accepts the settings as a number. Each switch has a value: read is 4, write is 2 and execute is 1. Add up the ones that are on for each set, and the three digits are the owner, group and others. So 755 is 7 (4+2+1, everything) for the owner and 5 (4+1, read and execute) for the group and everyone else, shown as rwxr-xr-x.
Special bits
A fourth digit in front adds three special bits: 4 is setuid (a program runs as its owner), 2 is setgid (a program runs as its group, or new files in a folder inherit the folder’s group) and 1 is the sticky bit (in a shared folder, people can only delete their own files). In the symbolic form they replace the x: s for setuid and setgid, t for sticky, shown as a capital letter when the execute switch under it is off. Be careful with setuid and setgid: a program that has them runs with more power than the person who starts it.
Questions
What should I use for a web site? Files are commonly 644 and folders 755, but your host’s documentation comes first. Is 777 a good idea? Almost never: it lets anyone on the machine change the file. Can I paste an ls-style string? Yes, a ten-character string like -rwxr-xr-x is accepted. Is anything sent anywhere? No, and your last value is remembered on this device only.