Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-18-2007, 11:10 AM   #1
LQ Newbie
Registered: Jan 2007
Posts: 7

Rep: Reputation: 0
Editing conf files

Hi, im having trouble editing the conf files in linux red hat. im logged on as root but for some reason im not able to edit any of the config files, i can only view them. i figure this must be to do with some security setting, just wondering if anyone had any ideas.
Old 06-18-2007, 11:23 AM   #2
Registered: Mar 2002
Location: Oklahoma
Posts: 981

Rep: Reputation: 36
sounds like SELinux doing its job, you will have to disable SELinux before editing any system files of this nature...
Old 06-18-2007, 11:24 AM   #3
Senior Member
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,977
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Some configuration files are read only (even to root). To override this in vi you have to add a ! to your command to write and quit a read only file:

To write a file that is read only but you DON'T want to quit:

Old 06-19-2007, 04:01 AM   #4
LQ Newbie
Registered: Jan 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for that I’ll give it a try, were about do you find SELinux by the way. also this is for custangro, what’s a Vi.
thanks again to both replies.
Old 06-19-2007, 05:35 AM   #5
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
vi is the default Unix editor, although on Linux it's usually symlinked (technical term) ie pointed to vim (vi improved).
You don't need to force writes like that, you just need to use the chmod cmd (see man page), but basically the permissions may not include write (w), so use something like this
chmod u+w filename

adds write priv to user (owner) of file.
check who the owner is first.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
editing conf files in red hat 8.0 kelmkone Red Hat 1 06-07-2007 08:31 AM
editing conf files Digitalsoldier Linux - Newbie 2 08-05-2005 06:59 AM
editing modles.conf thiqued Linux - Software 2 07-12-2004 03:56 PM
editing grub.conf dave37 Linux - Newbie 7 09-30-2003 07:10 AM
Editing modules.conf jatabe Linux - Networking 1 08-01-2003 01:47 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration