Try mount -o remount,rw /img/www/
, if that is not possible, you can copy the contents to a place where you can modify them, unmount the original /img/www/
and then symlink or "bind mount" the new location there.
How to edit read only file, as root without sudo
-
06-10-2022 - |
Question
I have a thecus home server, I'd like to edit the index.php file located under /img/www/htdocs/index.php
however it tells me every time I vi
that it's 'Read-only'.
I checked it's file permissions using ls -l index.php
:
-rw-r--r-- 1 root root 7619 Mar 29 2013 /img/www/htdocs/index.php
From my understanding, the -rw
first in the permissions, stands for the ownership permissions, and the owner is root in the group of root.
I have ssh'd into my server using:
ssh root@server.com
Once I login, it say's
root@127.0.0.1:~#
I have tried changing it's ownership, chmodding it, using vi to change permissions, trying to force it doesn't work either, how can I edit this damned file ! :(
When I try to use sudo
it say's the command is not found, so I'm assuming that's because Thecus have stripped down the commands.
The output of mount
without any arguments, I have noticed that the directory that I'm currently working in, is actually set to ro
, is there a way I can edit this?
/dev/cloop2 on /img/www type ext2 (ro,relatime,errors=continue,user_xattr,acl)
Any help would be great! :)
Solution