In as root but buffer says read only

Sometimes when I enter a configuration file:

ie.   cp dhcpd.conf.sample dhcpd.conf
emacs dhcpd.conf

I cannot make any changes becuase it says read only: I need to make changes
solunatecAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TeRReFCommented:
SOme files are permitted to be changed by root only. First you will have to become root.

su

then add root password
0
TeRReFCommented:
Sorry, I didn't notice the title. You say you're logged in as root? Then all text files should be writable. If not, try this as root:

Go to the directory the file you want to edit is in.

Then do this (as root)

chmod 644 your_filename

Then try to edit again (as root)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gheistCommented:
use vi and post exact errors you get.
0
dfxdeimosCommented:
If you are using VI, you can sometimes force a write with the ":w!" command.
0
fridomCEO/ProgrammerCommented:
Permissons can deny write rights to root. So check  the permissions of the file e.g you could do  
C-x d get a directory listing
M to change the mode
edit the file
return back to the directory listing
M to set the permissions to read-only again

or you can try
M-x toggle-readonly

or you can modify the find-file stuff to change the permissions to allow  write access then modify the buffer and then after-file-save you set the mode to read-only again, ther are hooks for that
find-file-hook
and after-save-hook

Regards
Friedrich

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.