putty-tools 问题,无输出

putty-tools 问题,无输出

我在使用从源代码编译的最新版本的 Putty 工具时遇到了问题。它们在某些 Red Hat 服务器上运行正常,但在其他服务器上却不行;我在所有工具上都没有输出任何输出。示例:

在职的;

[root@server1 dir]# /usr/local/bin/puttygen -t rsa -b 2048 -C "tmp" -o /tmp/test
++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++
Enter passphrase to save key:
Re-enter passphrase to verify:
[root@server1 dir]#
[root@server1 dir]# /usr/local/bin/puttygen
Usage: puttygen ( keyfile | -t type [ -b bits ] )
                [ -C comment ] [ -P ] [ -q ]
                [ -o output-keyfile ] [ -O type | -l | -L | -p ]
Use "puttygen --help" for more detail.
[root@server1 dir]#

不工作:

[root@server2 dir]# /usr/local/bin/puttygen -t rsa -b 2048 -C "tmp" -o /tmp/test

^C
[root@server2 dir]#
[root@server2 dir]# /usr/local/bin/puttygen
Usage: puttygen ( keyfile | -t type [ -b bits ] )
                [ -C comment ] [ -P ] [ -q ]
                [ -o output-keyfile ] [ -O type | -l | -L | -p ]
Use "puttygen --help" for more detail.
[root@server2 dir]#

该命令就停留在那里直到我退出,它对 puttygen、plink 等执行此操作。

除此之外,我安装了 havegen 来增加熵,但 plink 不返回数据。通过 plink 运行命令“hostname”的示例:

工作服务器

[root@server working]# cat /proc/sys/kernel/random/entropy_avail
3181
[root@server working]# /usr/local/bin/plink -v -ssh -i /sftp/private_keys/backup username@hostname hostname
Connecting to xx.xx.xx.xx port 22
We claim version: SSH-2.0-PuTTY_Release_0.70
Server version: SSH-2.0-OpenSSH_6.6
We believe remote version has SSH-2 channel request bug
Using SSH protocol version 2
Doing ECDH key exchange with curve Curve25519 and hash SHA-256
Server also has ecdsa-sha2-nistp256/ssh-dss/ssh-rsa host keys, but we don't know any of them
Host key fingerprint is:
ssh-ed25519 256 8c:cb:64:77:c4:35:a9:80:99:51:c0:f8:73:24:1d:dc
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Reading key file "/sftp/private_keys/backup"
Using username "username".
Offered public key
Offer of public key accepted
Authenticating with public key "rsa-key-20171024"
Sent public key signature
Access granted
Opening session as main channel
Opened main channel
Started a shell/command
Server sent command exit status 0
this.is.my.hostname.com
           Disconnected: All channels closed
[root@server working]#

没有返回数据服务器

[root@server notworking]# cat /proc/sys/kernel/random/entropy_avail
2962
[root@server notworking]# /usr/local/bin/plink -v -ssh -i /sftp/private_keys/backup username@hostname hostname
Connecting to xx.xx.xx.xx port 22
We claim version: SSH-2.0-PuTTY_Release_0.70
Server version: SSH-2.0-OpenSSH_6.6
We believe remote version has SSH-2 channel request bug
Using SSH protocol version 2
Doing ECDH key exchange with curve Curve25519 and hash SHA-256
Server also has ecdsa-sha2-nistp256/ssh-dss/ssh-rsa host keys, but we don't know any of them
Host key fingerprint is:
ssh-ed25519 256 8c:cb:64:77:c4:35:a9:80:99:51:c0:f8:73:24:1d:dc
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Reading key file "/sftp/private_keys/backup"
Using username "backup".
Offered public key
Offer of public key accepted
Authenticating with public key "rsa-key-20171025"
Sent public key signature
Access granted
Opening session as main channel
Opened main channel
Started a shell/command
Server sent command exit status 0
Disconnected: All channels closed
[root@server notworking]#

答案1

您应该看看您的系统上的可用熵。

RSA 密钥生成需要大量熵。我在未准备好的虚拟机上遇到了一些性能下降(大约 100 倍)。例如,如果cat /proc/sys/kernel/random/entropy_avail显示低于 100 的值,则可以安装。haveged

答案2

在 plink 命令中添加 -t 标志可以返回数据

enable / disable pty allocation

相关内容