Anyway, if you try it from shell prompt it is likely will not work as pressing ENTER shows the next prompt. Try `cat` followed by ENTER and then ~?
Anyway, if you try it from shell prompt it is likely will not work as pressing ENTER shows the next prompt. Try `cat` followed by ENTER and then ~?
Is this a current-ish version of OpenSSH or some other client/server?
EDIT Interesting! I tested it with fish and it does indeed intercept it! Wonder how that works.
Host *
EnableEscapeCommandline yesThe reason that is disabled in current OpenSSH by default is OpenBSD `pledge` support:
https://security.stackexchange.com/questions/280793/what-att...
On my Linux,
cat<Enter>~.
closes the connection as expected, and no ~ is shown in the terminal.I wonder if anyone still remembers the ctrl-[ sequence in telnet. I think I only ever used the quit command in that though.
The point of the return is to prime it to accept the start of a new escape sequence. Presumably the idea is that `~.` is not completely unlikely to occur as part of text entered remotely, but less so at the beginning of a new line.