The issue is that by the time you learn you need that or that your X and Y didn't suffice, you've already got a hung connection. So, now you want to restart the connection, maybe adding those options, but Ctrl+C is not killing ssh because it's trying to pass that to the server, too. So what do you do? Terminate with `~.`, then you can add `-o ServerAliveInter=X`, etc.
Without the escape sequences, your options are to use another terminal to `kill` the ssh client, or kill the whole terminal and start ssh in another. The problem with the former is that it might imply having to login again into the machine that has the ssh client. The problem with the latter is that you might be in multiple nested ssh sessions after having jumped through various servers, and closing the terminal kills everything instead of just the one that got hung.
Comments
The issue is that by the time you learn you need that or that your X and Y didn't suffice, you've already got a hung connection. So, now you want to restart the connection, maybe adding those options, but Ctrl+C is not killing ssh because it's trying to pass that to the server, too. So what do you do? Terminate with `~.`, then you can add `-o ServerAliveInter=X`, etc.
Without the escape sequences, your options are to use another terminal to `kill` the ssh client, or kill the whole terminal and start ssh in another. The problem with the former is that it might imply having to login again into the machine that has the ssh client. The problem with the latter is that you might be in multiple nested ssh sessions after having jumped through various servers, and closing the terminal kills everything instead of just the one that got hung.