(how to change ownership of folder in linux mint 21.63) Toggling ownership of a folder or file in Linux Mint 21.63 is one of the crucial procedures to implement whenever permission modification practices are being synthesized. Contrary to Windows, in Linux, each file or directory can belong to a particular user and group, and using the command, you can change the ownership, which changes rights for modification. This guide will explain how to transfer the ownership of a folder in Linux Mint 21.63 using the terminal.
Prerequisites:
- General knowledge of Linux file permission.
- Possessing a terminal (command line) interface, web browser, system, and network privileges, as well as others as seen in Fig.
- Using root or superuser account with sudo in Linux.
Step 1: Check the Current Ownership
Before the folder gets sold to another owner, it is important to know for sure who the owner is and what group the folder belongs to. This you can do using the ‘ls –l ‘. This is a terminal command that lists all the details of a specific folder.
This command will return information about the folder, including its owner and group. The output will look something like this:
In this case:
- user1 is the current owner.
- group1 is the current group.
Step 2: Change Ownership with chown
The chown (change ownership) command is used to change the owner and/or group of a file or folder. The basic syntax of the chown command is:
Example:
If you want to change the owner of a folder to newuser and the group to newgroup, you would use:
If you only want to change the owner and leave the group unchanged, omit the group part after the colon (:):
You can also change just the group by leaving the owner part empty:
Step 3: Change Ownership Recursively (for Subfolders and Files)
If you want to change the ownership of a folder and all of its contents (subfolders and files), you can use the -R (recursive) option:
This will apply the ownership change to the folder, all subfolders, and files within it.
Step 4: Verify the Change
After changing the ownership, verify the new owner and group using the is -1 command again:
You should now see the updated ownership information in the output.
Understanding Ownership and Permissions
In Linux, every file and folder has three types of access permissions:
Owner: The user who possesses the file/folder and has authority over the file/folder.
Group: A collection of users, their properties, and privileges for a particular file or folder on the computer.
Others: Those users whom we have restricted to, say, read-only but are not the owner or part of the specific group.
The chown command only changes the owner and the group of a particular file or directory.If the user requires permission or right modifications that involve the read, write, or execute then one can use the chmod command.
For example:
- This would set the folder’s permissions to:
- 7 (rwx) for the owner.
- 5 (r-x) for the group.
- 5 (r-x) for others.
Conclusion
Learning how to change folder ownership in Linux Mint 21.63 is easy and can be done using the chown command. If you need to allocate a folder to a new user or change access groups, chown is a powerful tool that allows you to handle the ownership of your files and folders with ease. Make sure you have the proper permissions to execute these operations and, to make sure that permission has been changed, the ls -l command should be typed to confirm this alteration.
Learn how to configure and modify folder ownership on Linux Mint 21.63 as this is one of the critical functions of system administration. By following the chown command, you can easily set users and groups as rightful owners of the files Or directories. One should always check changes to make sure one has the right permission that make the system function and is secure.