chown user:group <file>
or chown user:group -R <folder>
: Change the owner of a file or folder to a particular user and group. You cannot force user ownership unless you are root.chmod ### <file>
or chmod ### -R <folder>
: Change the permissions of a file or folder to use a permission triplet.ls -la
: List all the files and their owners in your current directorycd [path]
: Change Directory to [path]/home/kali/folder1/folder2
: Absolute File Path; this will never change.~/folder1/folder2
: Absolute File Path, relative to home directory. This shouldn’t change unless your home directory changes.folder1/folder2/
: Relative File Path, this depends on which folder you are in (see pwd
).On Linux, as we discussed previously everything is a file. Another feature of Linux is that all files in the file system must be “owned” by a user account and a group account. When you run ls -l
, you see all the metadata info for files, but ALSO the user and group owners for the files in the third and fourth columns:
There are many default users and groups on Linux, something to know is that on Linux, Users have IDs and Groups have IDs, which can be substituted for the name. Some notable groups include: