How to "sudo su" inside gedit to save mounted file
Let's say I mount a remote server using Nautilus (which is running on my laptop) and I'm not root on the remote server, and I want to use gedit to save a file owned by root on the remote server, is it possible for me to "sudo su" on the remote server from inside gedit so I can save the file?
I can edit the file from the shell, but I'd rather use gedit. Does this make sense? Both remote server and my laptop using Fedora.
Also I could just chown the file but I'd rather leave it as root:root.
3 Replies
Why not save the file as a normal user, then copy it in place as root?
@JshWright:
Why would you "sudo su"? That's pretty redundant in most cases…
Why not save the file as a normal user, then copy it in place as root?
I don't have the root password, I'm a user working for somebody.
I chown'd the file, works fine with gedit now (I asked the client first) so problem solved.
But I'm still interested if there's a way to have gedit automatically "sudo whatever" so I can edit files with "root" ownership.
(Yes, I'm pretty much a Linux noob.)
Editors like vim that live in the command line are a lot more efficient at editing text than gedit, once you learn them a bit. In addition you avoid these inconveniences.