[英]Trying to use ssh private key while using jmeter
我试图连接到需要私钥的远程主机,如何使jmeter使用此私钥进行连接?
我应该怎么做?
谢谢
您可以生成一个公共/私有rsa密钥对并将其保存在服务器上。 因此,不再需要密码。
如果您使用的是Linux:
$ mkdir ~/.ssh
$ chmod 700 ~/.ssh
这看起来像:(只需将密码短语留空)
$ Generating public/private rsa key pair.
$ Enter file in which to save the key (/home/<xxx>/.ssh/id_rsa):
$ Enter passphrase (empty for no passphrase):
$ Enter same passphrase again:
$ Your identification has been saved in /home/<xxx>/.ssh/id_rsa.
$ Your public key has been saved in /home/<xxx>/.ssh/id_rsa.pub.
现在您需要生成一个密钥:(创建一个4096位密钥)
$ ssh-keygen -t rsa -b 4096
Scp
服务器上的密钥:
$ scp /home/<xxx>/.ssh/id_rsa.pub <user>@<server_ip> <location_of_your_ssh_key_files>
Ssh
到您的服务器,并将密钥添加到您的身份验证密钥,首先备份它们:
$ cd <location_of_your_ssh_authkey_file>
$ cp authorized_keys authorized_keys_backup
$ cat id_rsa.pub >> authorized_keys
通常的位置是:
/home/<user>/.ssh/id_rsa
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.