I am looking for more information about Unix based systems, and there was a link:
about using permissions on Unix on the Mac.
The basic
chmodcommand goes:$ chmod ### directory/filename
Why wouldn't one just put:
$ chmod 777 directory/filename
Wouldn't that allow
drwx------: directory accessible only by ownerdrwxr-xr-x: directory anyone can access-rwxr-xr-x: file anyone can read and execute-rw-r-----: file only people in the group can read
to be
2
drwxrwxrwx: directory anyone could access?
1 Answer
There's nothing inherently dangerous about using
$ chmod 777 directory/filenamebut you need to be careful/selective as to which files/directories you apply it to.
This is because it makes all users able to read, write, and execute and this can be dangerous. This applies to your user profile, other users on that computer/OS, and possibly hackers from outside your machine that have breached it. If anyone other user got into your system that was unauthorized, they could view the data within, delete the file altogether, execute it for some malicious gain, etc.
That being said, there are other ways to set permissions with chmod that don't give quite as much freedom and you should make use of these other methods to give the least permission to any file as possible. But when you use the above command, this is giving the directory/filename the most possible permission.
For example, use$ chmod u+x filenameif you wanted to give permissions to just the user for just this file. For more beginner examples, see here.