bash 如何退出密码模式?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4921132/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 23:24:50  来源:igfitidea点击:

How to exit out of password mode?

linuxbashunix

提问by uXuf

If I Ctrl+C on a password prompt in shell (for eg during an scp or ssh), the shell is forever gone into the hidden characters (password) mode. There appears to be no way for me to start echoing the keystrokes to the display again and I have to logoff and log back in. Is there a simple way to force shell out of the password mode so that I can execute other commands?

如果我在 shell 中的密码提示上按 Ctrl+C(例如在 scp 或 ssh 期间),shell 将永远进入隐藏字符(密码)模式。我似乎无法再次开始将击键回显到显示器上,我必须注销并重新登录。是否有一种简单的方法可以强制 shell 退出密码模式,以便我可以执行其他命令?

This might be answered somewhere else (or might have a simple answer) but I cannot come up with suitable search terms that tell me how to do it.

这可能会在其他地方得到回答(或者可能有一个简单的答案),但我无法想出合适的搜索词来告诉我如何去做。

Thanks

谢谢

回答by Simon Richter

Whenever there is something wrong with the terminal, usually one of resetor stty sanewill get it back to a usable state. Which it is depends on the problem at hand.

每当终端出现问题时,通常其中之一resetstty sane将使其恢复到可用状态。它是什么取决于手头的问题。

回答by TyrantWave

Try typing reset, it should (As the command implies) reset the terminal.

尝试输入reset,它应该(如命令所示)重置终端。