• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 558
  • Last Modified:

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
0
solunatec
Asked:
solunatec
1 Solution
 
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
 
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
 
fridomCommented:
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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now