The file ~/.bashrc is often used to put personal alias, export variables or execute commands everytime a bash session is started. This file is called on interactive shells, that is, shells that require the input of a user name and password. However, when executing a custom commands via ssh or copying files over scp, usually it’s not necessary to set up the whole army, and some times it is even problematic. A good practice is to enclose all the personal stuff by an if statement that checks whether the shell is interactive, for instance, if the length of $PATH is non-zero:

if [ -n "$PS1" ]; then
	# junk for interactive shells goes here
fi