Today, while editing a file, I encountered the error: E45: Warning: Changing a readonly file, E45: ‘readonly’ option is set. This message generally indicates insufficient permissions. Even after re-assigning ownership with root using chown, the prompt persisted. After some trial and error, here is the solution for your reference:

Edit the relevant document using vim:
vim backup.sh
Press i to enter insert mode (the warning can be ignored).
Press Esc to exit insert mode, then type the following and press Enter:
:wq!
