Screen, remote login failure, and disappearing text

gnu-screen

When in a screen session via ssh, if I attempt to connect to another host via scp or ssh and the auth fails, any subsequent text I type in the terminal will not be displayed, however it is being entered and can be executed.

[user@host Oracle]$ scp user2@host2:/path/to/files .
user2@host2's password:
Permission denied, please try again.
user2@host2's password:
[user@host Oracle]$
[user@host Oracle]$
[user@host Oracle]$
[user@host Oracle]$
[user@host Oracle]$ [user@host ~]$ [user@host ~]$

What you can't see above is that I did 'cd' on the last line. It executed but output stays on the same line. ^C will give me a new line.

Is there a way to recover without losing my screen session?

Best Answer

stty sane, or more specifically stty echo, should turn echo back on. (stty sane will fix other terminal input or output oddities such as newlines not going back to the left margin.)

Ssh (and most other programs) turn echo off for the password prompt, i.e., the characters you type are not displayed (echoed) to the screen. stty -echo is a shell command with the same effect. Normally echo should be turned back on (like stty echo) after the password prompt; this is a bug in either ssh or some other software at play here such as your system libraries or terminal emulator.

Related Question