I ran geany without sudo. I opened a file (jail.local) and modified it. Now I can't save it back to the original file. Is there a way to execute a [menu] command (e.g. File/Save) "as super-user"?

  • @Anwar I don't think it's the same. – TheWanderer Aug 29 '16 at 20:10
  • @OP you can just copy the text, close the file without saving, reopen with sudo and paste the edited text in. – TheWanderer Aug 29 '16 at 20:10
  • 2
    geany doesnt allow running as root. ( at least in new versions) – j0h Aug 29 '16 at 20:42

If your question is specific to Geany, the answer is No. Geany has no option to dynamically switch to the role of a privileged user. The only viable option is save the changes to another file (possibly with same name) using the Save As feature and then move the file back to original location using sudo mv replacing the original file. That will do the job of saving.

But, if you're looking for any generic GUI application that will allow you to save as root without opening it first as root, there is Sublime Text 3.

Sublime Text has a feature which will ask you root password when you want to save edits made on system files, even if you originally started it as a normal user. You may consider it in place of geany from now on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.