Armin Goralczyk <[EMAIL PROTECTED]> writes: > Hi > How can I edit a file that is write protected by superuser rights? I > can visit the file but it is read-only. I removed read-only > protection by C-x C-q (toggle-read-only) but after editing I cannot > save the file. Minibuffer says: > File fink.conf is write-protected; try to save anyway? (yes or no) -> > yes > Doing chmod: operation not permitted > > So how can I save the file provided that I can have superuser rights? > > Thank you > Regards > Armin >
Well, first of all you need to somehow let emacs know you have superuser rights. The obvious way to do this is start emacs while logged in as the super user. However, this is a bad way of working. The easiest alternative is to use tramp and define a "sudo" method. You will need to have sudo configured for this to work. The idea is outlined in detail in the tramp manual (at least it use to be last time I read it some time back). If you don't want to go to this extent, the other solution is to copy the file to your home directory, edit it and then copy it back after su'ing to root or using sudo. Note that I'm assuming your running under some form of unix or linux and that your not logged in as the su when starting emacs. If you are not running on unix/linux, then I cannot help. Tim -- Tim Cross The e-mail address on this message is FALSE (obviously!). My real e-mail is to a company in Australia called rapttech and my login is tcross - if you really need to send mail, you should be able to work it out! _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs