Well, sorry, but I have to ask again… “can’t edit the file” is so unclear…
* Does it give you an error message that tells you you can’t edit it?
* If so, what’s the exact words of the error message?
* Or did it complain only after editing, when trying to save the changes?
* In that case, what exactly did it say?
* Or don’t you know how to use vi? vi is a bit complicated, you can’t just starting to type ahead (press i to go into insert mode, do the changes, press escape to get back to command mode, type :w to save the changes, then :q to quit the editor), nano or pico may be easier to use editors.