SSH:

autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3"  -i ~/.ssh/ec2-keypair-1 [email protected]

SSH tunnel:

autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3"  -i ~/.ssh/ec2-keypair-1 -NfL localhost:8889:localhost:3389 [email protected]