SSH Cheat Sheet/Configure keepalives

Send keepalive probes to keep long sessions open.

Section: Useful Options

Configure keepalives

bash
bash
ssh -o ServerAliveInterval=30 -o ServerAliveCountMax=3 user@example.com
Explanation

Send keepalive probes to keep long sessions open.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Useful Options
Set connect timeout
Fail quickly if the host is unreachable.
OpenIn sheetbashsame section
Enable compression
Compress traffic for slower links.
OpenIn sheetbashsame section
Disable escape character
Prevent ~ escape handling in raw sessions.
OpenIn sheetbashsame section
Run a local command after connect
Execute a client-side command when the connection is established.
OpenIn sheetbashsame section
Connect to a host
Open an interactive SSH session.
OpenIn sheetbash1 tag match
Use a specific private key
Choose a private key explicitly.
OpenIn sheetbash1 tag match