Search
Close this search box.

Throwing My Bash Functions / Aliases On Any Machine I SSH Onto

INFO

I am tired of always having to manually add my commonly used aliases on every machine I connect to, so I found a way to throw them on any machine I SSH onto. It will also remove them after I drop the connection.

CODE

gogo() {
  scp ~/.bashrc $1:/tmp/.bashrc_temp
  scp ~/.bash_profile $1:/tmp/.bash_profile_temp
  ssh -t $1 "bash --rcfile /tmp/.bashrc_temp /tmp/.bash_profile_temp ; rm /tmp/.bashrc_temp /tmp/.bash_profile_temp"
}

LINKS

https://superuser.com/questions/503784/loading-local-shell-aliases-to-ssh-session-dynamicaly

Share this Post:
Scroll to Top