Did you know that you can do this:
ssh -t user@machineB ssh user@machineA
That is, you can execute an ssh client command, over ssh. The '-t' option is required.