Ontario Tech Logo

Escape character "~" in Linux terminals causes SSH session to close

The console managers in the lab use the "~" key as an escape character, which is used to return to the menu. By default, Linux systems use the same escape character to close SSH sessions, which can result in a user unintentionally closing their SSH session when attempting to return to the console manager menu.

This can be fixed by modifying your local ssh_config file, which is usually located in /etc/ssh/If you cannot see this file here, you can run the command locate ssh_config

Open ssh_config with your text editor of choice and look for the following line:

#   EscapeChar ~

Uncomment this line and change the value to something other than "~". For example, if you want to change the EscapeChar value to "+", you would modify it as follows:

   EscapeChar +

This will prevent the tilde key from closing SSH sessions entirely, and allow you to use the console manager's exit command as intended.

 

Article Details

Article ID:
18
Date added:
2019-03-22 11:38:40