I am trying to edit a configuration file so called config from /etc/selinux/config in Oracle linux. I have tried using gedit and with terminal but I still get the same error.

Error: Can't save. Permission Denied!

I am doing it all in a Oracle VM VirtualBox.

Please help me fix this.

Thanks in advance.

  • Questions on Oracle Linux should be asked on Unix & Linux. – muru Feb 9 '16 at 19:13

Here are the steps you need to follow:

  • Go to /selinux and from file menu choose open in terminal
  • Now when you are in terminal window type su and press enter. It will ask you for a password. Enter it.
  • go to your /selinux directory use cd command (you may be aware of that)
  • type ls to check whether config file is showing or not. If showing proceed further.
  • type vi config (a vi editor with config file content will be opened)
  • go to the area you want to make changes by pressing i on the keyboard. Edit your text.
  • Press Esc and type :wq (colon with wq)

w - save

q - quit

Please do note that if you try to save from terminal file menu, it won't get saved. You must have to specify :wq to make changes to your file.

This is the way you can edit any configuration file in linux or unix.

Hope this will solve your problem. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.