Kali Linux Change File Owner
Welcome Kali User! The Tutorial Shows You Step-by-step How-to Change File/Directory Owner on Kali GNU/Linux Desktop.
And the Kali Linux Change File Owner instruction is to Set a different Owner for Files and Directories on the Kali Linux File System.
Furthermore Mastering the Ownerships Over Files and Directories is the First Step in Setting Up Permissions and so Establishing a Security over the System.
Finally Following the Tutorial You will Get a Little Practice with the Kali Linux Shell Command Line.
Kali Linux Terminal Tutorial for Beginners:Kali Linux Terminal Quick Start
Who Can Set/Change the Ownership?
Only the Administrators or a Super-User Can Change a File/Directory Ownership!
(First of all the root User is the Default one in Kali, so the following instructions are intended for a Normal User)
So to Check What User you are on:
Then if you are “root” No “sudo” is Needed!
How to Set/Change the Ownership?
To Set/Change Ownership Over a Single File/Directory:
sudo chown [myUser]:[myGroup] [myEntity]
Where [myUser] is your’s user Name & [myGroup] is your’s user Primary Group.
How-to Look Up User Name & Group on TerminalFind User Name & Group
mkdir -p $HOME/hello/world
Now to Give the ‘world’ Directory to the ‘root’ User do:
sudo chown root:root $HOME/hello/world
ls -l $HOME/hello
To Set/Change Permissions Recursively Over a Directory and it’s Content (Subdirectories and Files):
sudo chown -R [myUser]:[myGroup] [myEntity]
sudo touch $HOME/hello/world/happy
ls -l $HOME/hello && ls -l $HOME/hello/world
Now to Get Back the ‘world’ Directory with the ‘happy’ File:)
sudo chown -R [myUser]:[myGroup] $HOME/hello/world
Check again Ownership like Above…
How-to Change Permissions on Kali Linux File System:Kali Linux Change Permission Shell