I am working in various Linux and UNIX environments.

I'd like to elegantly solve the problem of editing remote configuration files over SSH. Instead of using terminal editors (nano), I'd like to open the file in a local text editor on my desktop (Sublime Text 2).

CyberDuck, WinSCP and various other SFTP apps can do this.

Using editors over X11 forwarding has also proven to be problematic. Also using archaic text editors like Vim or Emacs do not serve my needs well. They could do this, but I prefer using other text editing software.

Using ssh mounts (FUSE) are also problematic unless they can happen on the demand and triggered by the remote site.

So what I hope to achieve

  • Have a somekind of easily deployable shell script etc. which I can copy to remote server (let's call it mooedit)

  • I run mooedit command on the remote server of which I have connected over SSH connection

  • mooedit sends some kind of signal (over SSH( to my local desktop

  • On my local desktop this signal is captured and it determines 'a ha! moo wants to edit a file on server X in folder Y'

  • File is SFTP transfered to the local desktop (/tmp)

  • File is opened in a nice GUI text editor on the local desktop

  • When Save is pressed, the local desktop notices changes in the file and SFTP sends the resulting file back to the server

The question is:

  • What signaling mechanisms SSH provides for this?

  • Any other methods to trigger a local text editor for remote SSH file?

link|improve this question

75% accept rate
This is not a question. – P.T. Sep 27 '11 at 7:23
Thanks. Added some question marks. – Mikko Ohtamaa Sep 27 '11 at 7:27
3  
The word is archaic, and they're not. Both Vim & Emacs can easily edit a remote file using builtin commands. – telornix Sep 27 '11 at 7:49
1  
@MikkoOhtamaa: your workflow is unclear: the server side tells your local editor that the server wants you to edit a file? – akira Sep 27 '11 at 7:56
@akira I reworded some sentences... clear now? – Mikko Ohtamaa Sep 27 '11 at 8:28
show 3 more comments
feedback

1 Answer

I'd like to elegantly solve the problem of editing remote configuration files … Any other methods to trigger a local text editor for remote SSH file?

Use something like webmin. Either an existing module or create one for your purposes.


Update:

It is possible to make Apache serve a HTTPS page (via a back-end script) that shows the text file in a textarea and use (It's All Text to launch any local text editor. This obviously requires some care regarding security.

link|improve this answer
Does webmin somehow solve the problem of launching a local text editor? – Mikko Ohtamaa Sep 27 '11 at 9:33
@MIkko: Yes, insofar as you can locally (in your local web-browser) edit the contents of a remote text-file. If you don't consider a local browser's GUI textarea widget (commonly used for editing text) or dedicated set of other widgets, a suitable "text editor", you'll have to look elsewhere. – RedGrittyBrick Sep 27 '11 at 10:05
feedback

Your Answer

 
or
required, but never shown

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