Skip to content

Instantly share code, notes, and snippets.

@broedli
Last active January 3, 2017 03:16
Show Gist options
  • Save broedli/717b502cb0a1dbd636ab to your computer and use it in GitHub Desktop.
Save broedli/717b502cb0a1dbd636ab to your computer and use it in GitHub Desktop.
Taking ZSH configuration files to SSH host

To automate a seemles terminal experience over an SSH session I do this:

~/.ssh/config:
--------------
Host *
   PermitLocalCommand yes 
   LocalCommand tar c -C${HOME} .config/zsh .zshrc .vim .vimrc .tmux.conf \
               | ssh -o PermitLocalCommand=no %n "tar mx -C${HOME} ; chsh -s /bin/zsh"

Alternative in a bash script:

~/Scripts/tools/zsh-ssh.sh <REMOTE>
--------------
#!/bin/zsh
tar c -C${HOME} .config/zsh .zshrc .vim .vimrc .tmux.conf | ssh $1 'tar mx -C${HOME}' 
ssh -t $1 "/bin/zsh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment