Error: EACCES: permission denied

In Milestone 1 after executing this command server is started.
sudo chown root ./vsftpd_v1 vsftpd_v1.conf
But if try to make any changes to file vsftpd_v1.conf getting the below error
“Failed to save ‘vsftpd_v1.conf’: Unable to write file (NoPermissions (FileSystemError): Error: EACCES: permission denied, open ‘/home/crio-user/workspace/QBox/vsftpd_v1.conf’)”
tried changing the permission using the command chmod +x vsftpd_v1, getting the below message
“chmod: changing permissions of ‘vsftpd_v1’: Operation not permitted”.

Hi @Rajinikanth
Looks like you are facing challenges in the current module.
Here are a few FAQs that we think might be helpful for you

Below is a link to all the FAQ’s for the current module

Below are a few similar topics raised by other users which you might find usefull

Note - This is a BETA Feature,if you find this helpful, kindly let us know.
Feedback link - https://forms.gle/cmxN5pdTXgnwgC986

Kindly mark this as a solution if this has helped you solve your query

Let’s try to divide and conquer the issue

In Milestone 1 after executing this command server is started.
sudo chown root ./vsftpd_v1 vsftpd_v1.conf

Ok, so we need to use sudo chown root ./vsftpd_v1 vsftpd_v1.conf before starting the server. What does chown do?

But if try to make any changes to file vsftpd_v1.conf getting the below error
“Failed to save ‘vsftpd_v1.conf’: Unable to write file (NoPermissions (FileSystemError): Error: EACCES: permission denied, open ‘/home/crio-user/workspace/QBox/vsftpd_v1.conf’)”

And as you rightly mentioned, if we try to edit the configuration file then, our good old friend VS code will warn about not being able to save the edits. When we make edits using the IDE text editor, are we a root user or a normal user?

Tried changing the permission using the command chmod +x vsftpd_v1, getting the below message
“chmod: changing permissions of ‘vsftpd_v1’: Operation not permitted”.

Hmm. So, when Linux says we don’t have permission to do something, how do we force it to conform?
image

chown is used to change the ownership of file or directory.
When executed with sudo it’s shows as executed but still I’m not able to save the changes.

Yes, exactly. We use chown to change ownership of the file.

Let’s look at some points

  1. To start the vsftpd server, we need the conf file to be owned by the root user - this is why we are doing sudo chown root ./vsftpd_v1 vsftpd_v1.conf as you mentioned which changes ownership of both the server application & the conf file as root

  2. Now, to edit the files using the IDE, we need edit permissions. Here, “we” will be normal user and hence we’ll need to give the ownership to crio-user for editing the config file.

Thanks, After changing the file permissions to crio-user I’m able to save the changes.

1 Like

Cool. Happy Learning By Doing!

Closing this topic as your issue is resolved by the mentor. If it is still not resolved, Kindly un-mark the accepted solution or create a new topic and post this question as a reference link in the description of the new topic.