I have my bashrc file set up to my liking.I usually work on a hardware that is plugged into a remote server.I ssh into that remote server.I would like my .bashrc to be run when I ssh into the remote server,instead of the bashrc on the server.Is there anyway by which I can accomplish this.?
AFAIK, there is no way to do that.
Maybe you should copy your
~/.bashrc
to a server and install a configuration management tool (Puppet, Chef, ...) on all the other servers to pull it.I think sshrc is what you're looking for: https://github.com/Russell91/sshrc
You can use this to set environment variables, define functions, and run post-login commands. It's that simple, and it won't impact other users on the server - even if they use sshrc too. For more advanced configuration, continue reading.
I think that https://github.com/fsquillace/pearl-ssh does what you need.
I wrote it long time ago before sshrc was born and it has more benefits compared to sshrc:
For instance: