Originally Posted by JCole123
How come the first code is dangerous?
When you issue 'chmod 777' you are giving read
to not only yourself and people in your group, but to everyone else too. Should you be compromised or have multiple users on your system, the attacker or other users have unfettered access to your files in that specified folder and files in any sub folders. They can do anything they want to (or with) your data. Adding -R
(recursive) means those permissions will be applied to all data within the specified folder and sub folders.
& ls -ld $home
are two separate commands. The first will command will output something like this:
uid=500(username) gid=500(username) groups=500(username)
The second command will output something like this:
4 drwxr-xr-x 2 username username 4096 2010-06-24 01:42 Desktop/
4 drwxr-xr-x 8 username username 4096 2010-07-14 00:21 Documents/
4 drwxr-xr-x 11 username username 4096 2010-07-15 00:25 Download/