Here's a solution that might work.
Open a terminal window and edit your bash profile:
pico ~/.bash_profile
In the profile, add the following function:
function tabname {
printf "\e]1;$1\a"
}
Save and quit the editor (control-o, control-x), and then create a new bash session. Now when you type the following command you can change the name of the tab:
tabname NAME
(credit to The Lucid for this: http://thelucid.com/2012/01/04/naming-your-terminal-tabs-in-osx-lion/)
With this setup, you can add this command before your ssh command in the following manner:
tabname NAME; ssh username@host
You can also script this behavior in the following manner. First create a script called "myssh.sh" or something similar, and then add the following to it:
!#/bin/bash
printf "\e]1;`echo $1 | sed -Ee 's/^.+\@//'`\a"
ssh $1
printf "\e]1;bash\a"
When you run the script, use it as a replacement for the ssh command (if you need to add arguments, then encase them in quotes or escape the spaces between them). For example, see below:
./myssh.sh "-p 22 username@host.com"
or...
./myssh.sh -p\ 22\ username@host.com
If there are no arguments then you can simply use the following:
./myssh.sh username@host.com
One issue with this script is that if you cancel the connection or otherwise kill the command without doing so cleanly, then the script will halt and leave the name of the tab as the hostname. The last line of the script should rename the tab back to "bash" when done if the ssh session exits cleanly and allows the script to continue.