Shell – Using a local shell on a remote machine

linuxshellssh

I use zsh with a bunch of customizations on my local machine. I recently started using homemaker to manage all my dotfiles in a git repo on a private server. However, it always strikes me as awkward that when I ssh in to a remote server, I either need to put up with the local config, or waste time cloning a private git repo and running scripts. It also strikes me as unprofessional for me to download a bunch of personal files to a server I'm maintaining, especially if I'm not the main administrator.

It seems like there must be a better way. Is there some sort of system that allows me to run my carefully configured local shell, but all of the actual actions (file I/O, running commands/commadn stdio, etc) run over some sort of ssh-based interface? I'm imagining some sort of super-minimal non-human-friendly shell (for the sake of this question, let's call it syssh) on the server that just exposes all the system calls a modern shell could use, and on the client a modified shell that reads local configs but sends syssh commands to the remote system.

This way, the server doesn't have to care about my preferred shell, promptline theme, color preferences, terminal capabilities, fonts (for powerline etc), tab completion preferences, etc. Also, network latency would not slow down my typing since readline() is happening locally; the only thing that would lag would be the results of commands (and tab completion stuff, etc). I know mosh addresses this problem through a bunch of heuristics and assumptions about how a shell would behave, but it seems a bit hackish.

The way it seems to me, running a shell over ssh is like using a web app where every single button is a link or form submit button, mosh is the same app with some caching and a differential compression scheme, and what I'm proposing would be like a modern webapp with Javascript manipulating the display and AJAX calls to get/post data when needed.

Does such a thing exist, and if not, why? Are there any known development efforts towards such a thing?

Best Answer

It sounds like what you want is Microsoft's Web Services for Management which is the basis for powershell remoting. Powershell for Linux exists and is MIT licensed so it should in theory be possible to extract the necessary code and turn it into a patch for zsh. Of course not everyone will have powershell installed but the not everybody has zsh installed.

In short what you want exists but not (yet) for zsh.

Related Question