Skip to content

Instantly share code, notes, and snippets.

@jograb
Created July 24, 2016 18:51
Show Gist options
  • Save jograb/6c8aaf0a237ae0af6bb0b551fff3525f to your computer and use it in GitHub Desktop.
Save jograb/6c8aaf0a237ae0af6bb0b551fff3525f to your computer and use it in GitHub Desktop.
Use a local .bashrc on a remote machine. For example for aliases. // Have to be placed @ .bashrc-file (local) Raw
sssh() {
name=$USER
ssh ${*:1} "cat > /tmp/.bashrc_$name" < ~/.bashrc_remote
ssh -t ${*:1} "bash --rcfile /tmp/.bashrc_$name ; rm /tmp/.bashrc_$name"
}
@jograb
Copy link
Author

jograb commented Jul 24, 2016

Usage: After you've placed the snipped above in your local .bashrc-file you can use it like normal ssh. You just have to replace "ssh" with "sssh" (3 s).

For example "sssh user@host"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment