Skip to content

Instantly share code, notes, and snippets.

@balbuf
Created November 29, 2018 19:57
Show Gist options
  • Save balbuf/abc94fffb70bc07173af621a5673c621 to your computer and use it in GitHub Desktop.
Save balbuf/abc94fffb70bc07173af621a5673c621 to your computer and use it in GitHub Desktop.
SSH with local aliases applied
# establish an ssh session with the given args and apply all of your local bash aliases
# use just like you would ssh to login to a remote shell, e.g. `ssha user@host`
function ssha() {
ssh -t "$@" 'bash --init-file <(echo '"$(printf %q "$(alias)")"')'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment