Week 2 - Misconfigured File Permissions
-
Everything within Linux is a file
-
File permissions can cause unauthorized users access to the contents of files
- Meaning that the contents could be changed
- e.g. Changing the hard coded binary passwords with a known password
- This breaks confindentiality, Integrity, and availability
- Export PATH=/path/to/directory
- Changes the path variable
- find
- Search for files in a directory
- locate
- Find files by name, quickly
- which
- locate a command
- U: User
- G: Group
- O: Others
- R: Read
- W: Write
- X: Execute
If there is an ‘S’ in the file permissions, it is a special permission for the user access level and always executes as the user who own the file. - chmod u+s <file/dir>
Allows a file to be executed as the group owner of the file - chmod g+s <file/dir>
Restricts the deletion at directory level - chmod o+t <file/dir>
- U - User
- G - Group
- S - SUID
- chmod <Permision> file
- Change file permissions
- chgrp <Group/GID> file
- Change group ownership of a file
- chown <User/UID> file
- Change User ownership of a file
- sudo <command>
- Run the command as the root user