I would like to run several commands on one SSH session. For example, my script right now has something like the following:
ssh "machine A" do-thing-1
ssh "machine B" do-thing-2
ssh "machine A" do-thing-3
Having to SSH to A again in the third line is wasting a lot of time. How do I execute this without having to SSH again? Is this possible?