Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
    
Thank you, that was awesome! –  Dave Dec 10 '10 at 21:48
1  
reset is also useful for general terminal issues besides disabled echo –  Michael Mrozek Dec 11 '10 at 8:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.