我需要从 SSL 私钥文件中删除密码。我正在使用
openssl rsa -in in.key.pem -out out.key.pem
要做到这一点。我面临的问题是该 key 文件的密码(密码是在某处不同的机器上生成的)看起来像这样:
~Casdfghetc
正如您可能已经发现的那样,该密码的“~C”部分会产生一个新的命令行,让我无法正确输入密码。引号,双引号等不起作用。
我正在使用 putty 连接到这个 shell,通过一个黄金主机(powerbroker)跳跃。这是一个高效、安全的环境,因此我无法以任何其他方式登录机器。关于如何让它发挥作用的任何提示?
最佳答案
方式1.作为http://www.jedi.be/blog/2010/08/27/ssh-tricks-the-usual-and-beyond/指出:
Escape sequences are only recognized after a newline
因此,当要求输入密码时,您可以执行以下操作:
a
. 方式 2. 在我的系统上,按“~?”显示以下帮助:
Supported escape sequences:
~. - terminate connection (and any multiplexed sessions)
~B - send a BREAK to the remote system
~C - open a command line
~R - request rekey
~V/v - decrease/increase verbosity (LogLevel)
~^Z - suspend ssh
~# - list forwarded connections
~& - background ssh (when waiting for connections to terminate)
~? - this message
~~ - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)
所以,要在换行符之后插入波浪号(
~
),我只需按两次( ~~
)。可能对您的系统也是如此:只需键入 ~~Casdfghetc
而不是 ~Casdfghetc
.
关于密码中的 SSH 转义序列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32028387/