HostArmada Web Hosting Knowledge Base

Knowledge is power! Use that power and achieve total and unconditional control over the Web Hosting Services!

How can I change the ownership of my files and folders?

Before we get into the explanation about the command used to change the ownership of files in Linux, let us go over what the "ownership" actually is.

What is file "ownership" in Unix?

Linux is a multi-user Operating System designed to accommodate a lot of users concurrently. This fact created the necessity of implementing a system, that keeps careful track of who is allowed to access a file or directory. These rules are called permissions, which are explained in this article. When a file or folder is created, the owner becomes the user who created it. The group will have the value of the group the user belongs to.

How can I change the ownership?

Changing the ownership is done via the chown command. Here is the basic syntax:

chown  <file/folder>

Here is an example so you can get a better understanding:

chown armadauser:hostarmadagroup public_html

This command will set the ownership of the public_html folder as seen below:

drwxr-xr-x 2 armadauser armadagroup 4096 Apr 9 12:10 public_html

If you want the ownership to be the same for the user and group, you can write the command in this way:

chown armadauser: public_html

When the above is executed, the group will be omitted, and the same value defined for the user will be set for the group as well. Here is what this will look like:

drwxr-xr-x 2 armadauser armadauser 4096 Apr 9 12:12 public_html

When you host your projects with HostArmada, the user group ownership will be identical.

Was this article useful and on point?

Find out more about HostArmada entire range of optimized Web Hosting Services and take action today on improving your website Loading Speed, Security, and overall Stability!