Change ownership of the file
This also gives a Permission Denied error to a user in a mixed system when the user doesn’t have the access to a particular file. We can add users using the chown command.
Step 1: First, check the users who have access using the following command.
ls -l
Only a single user and a single group have access to read, write and execute as can be seen in the output.
Step 2; Now add the user geeks using the following command.
sudo chown geeks geeks.txt
Now check the owners of the file. The output is as follows:
So the user geeks now has the access to the text file.
How To Resolve Permission Denied Error On Ubuntu/Debian?
Linux is a community of open-source Unix-like operating systems that are based on the Linux Kernel. Linux distributions are constructed in such a secured way that a user cannot make changes unless he/she has administration access. Users who are first time exploring Linux encounter the problem of Permission being Denied. In this article, we will learn how to fix them with the following methods.
- Sudo command missing
- Insufficient permissions to access the files
- Change ownership of the file
Let’s explore all the methods one by one.
Contact Us