为什么波浪号 V 输出 ~V [LogLevel ERROR]?

Cam*_*out 2 ssh password git

我使用 github 帐户的密码变体之一包含字符~V. 当提示输入密码以推送到 Github 时,我输入~V并输出

~V [LogLevel ERROR]
Run Code Online (Sandbox Code Playgroud)

为什么是这样?

mur*_*uru 5

我认为您正在进行 SSH 会话。SSH 允许您使用某些“转义”序列向 SSH 本身(而不是您登录的 shell)发送特殊命令。来自man ssh

ESCAPE CHARACTERS
 When a pseudo-terminal has been requested, ssh supports a number of
 functions through the use of an escape character.

 A single tilde character can be sent as ~~ or by following the tilde by a
 character other than those described below.  The escape character must
 always follow a newline to be interpreted as special.  The escape
 character can be changed in configuration files using the EscapeChar
 configuration directive or on the command line by the -e option.

 The supported escapes (assuming the default ‘~’) are:
 ...

 ~V      Decrease the verbosity (LogLevel) when errors are being written
         to stderr.

 ~v      Increase the verbosity (LogLevel) when errors are being written
         to stderr.
Run Code Online (Sandbox Code Playgroud)

因此,如果您按下Enter用户名提示,那么~V作为密码的前两个字符,SSH 会将其解释为增加日志详细程度的命令。

因此,通过 SSH,输入~V密码的前两个字符,或者:

  1. ~两次,以便将其视为文字~(根据上面引用中的第二段):~~V, 或
  2. 在提示开始时执行一些操作以中断序列(例如,键入一个字符并删除它)。