Linux File Permissions in Ten Minutes
Read, write and execute for user, group and others. Once you can read a permission string, most “permission denied” errors explain themselves.
Run ls -l and each line starts with a string such as -rw-r--r--. After the first character, which shows the file type, come three groups of three letters: permissions for the owner, the group, and everyone else.
$ ls -l deploy.sh
-rwxr-x--- 1 deploy ops 812 Oct 15 09:12 deploy.shHere the owner can read, write and execute the script, members of the ops group can read and execute it, and nobody else can do anything with it.
Changing permissions
$ chmod g-x deploy.sh # remove execute for the group
$ chmod 640 config.env # owner read/write, group read, others nothing- Linux