当我们想要使用pssh来并行地从远程机器获得命令输出时,我们可以这样做(例如)
pssh -H presto01 -l root -A -i "hostname"
Warning: do not enter your password if anyone else has superuser
privileges or access to your account.
Password:
[1] 11:55:56 [SUCCESS] presto01
presto01但是如何做到不输入密码,那么密码就会自动午餐吗?
发布于 2019-07-14 12:24:22
我们可以用飞碟
sshpass -p customer pssh -H presto01 -l root -A -i "hostname"发布于 2019-07-22 03:47:00
您可以设置一个基于密码的服务器和客户端之间的身份验证。
下一个源/导出服务器上的ssh-代理。
# eval `ssh-agent` ssh-add /root/.ssh/id_rsa 在这里,我假设我的私钥存储在上面提供的路径/root/..ssh下面
一旦您给出密码,ssh代理将执行无密码连接。现在,您可以不使用"-A“选项执行pssh操作。
关于PSSH的更多示例(请与PSSH一起检查使用SSHD选项)
https://www.golinuxcloud.com/pssh-commands-parallel-ssh-linux-examples/
在我的设置中,我已经配置了无密码配置,我更喜欢使用下面的附加sshd选项的pssh。
StrictHostKeyChecking=no
GSSAPIAuthentication=no
PreferredAuthentications=publickey
PubkeyAuthentication=yeshttps://unix.stackexchange.com/questions/530079
复制相似问题