only try ssh to M's machine if it pings successfully