Escape characters
When a pty has been requested, ssh supports a number of functions through the use of an escape character.
A single tilde character can be sent as "~~" or by following the tilde by a character other than those described later in this section. The escape character must always follow a newline to be interpreted as a special character. The escape character can be changed in configuration files using the EscapeChar configuration option or on the command line by the -e option.
The supported escape characters (assuming the default "~") are:
- ~.
- Disconnect.
- ~^Z
- Background ssh.
- ~&
- Background ssh at logout when waiting for forwarded connections or X11
sessions to terminate.
Restriction: This option is not supported if running in FIPS mode, or Key Exchange algorithms are implemented using ICSF.
- ~#
- List forwarded connections.
- ~?
- Display a list of escape characters.
- ~B
- Send a BREAK to the remote system.
The ~B escape character is useful only for protocol version 2 and if the peer supports it.
~C
Open command line. Use this option to do the following tasks: - Add port forwardings using the -L, -D, and -R options (see -L option, -D option, and -R option).
- Cancel existing port forwardings using the -KL[bind_address:]port for local, -KR[bind_address:]port for remote or -KD[bind_address:]port for dynamic port-forwardings.
- Execute a local command if the ssh_config keyword PermitLocalCommand enables the feature (for example, !command).
- Get basic help using the -h option.

- ~R
- Request rekeying of the connection. Restriction: The ~R escape character is useful only if the peer supports it.
- ~V
- Decrease the verbosity (LogLevel) when errors are being written to stderr.
- ~v
- Increase the verbosity (LogLevel) when errors are being written to stderr.