Text editor that can edit using sudo over ssh?

db-user picture db-user · Dec 6, 2013 · Viewed 25.1k times · Source

I'm trying to edit files on a remote Amazon EC2 Linux instance. I'm currently just sshing in and using nano, but would really like a graphical text editor. I have two problems:

  1. I have to use sudo to edit these server files when I ssh in.
  2. I can only login with the key Amazon gave me. Ex: ssh -i Andrew.pem [email protected]

Please help! I'm not picky, just any graphical text editor since using nano is a huge pain.

Answer

Charles Duffy picture Charles Duffy · Dec 27, 2016

For remote editing, there are lots of options here: This answer, like any other, is sure to become outdated as more options enter the field.

I'd suggest starting with the editor you prefer and evaluating options from there. If you set up your SSH session to be able to authenticate directly to root (password auth is best disabled for root, but if you have sudo you can install RSA keys), then you'll be able to specify root as a target user for any of the above.


By contrast, if you really do need sudo, you still have options: