I'm able to run a script automatically every time I log into my machine via SSH by placing a command in the
/etc/ssh/sshrc file. That works perfectly, however it's only triggered when I log in via terminal or SFTP file browser like Transmit.
It does not run my script when I connect to a MySQL or MongoDB instance over SSH (where the database host is
localhost through an SSH tunnel, see below).
How can I ensure this script gets run on every SSH connection to the server?