ssh-******  -t(指明算法)  dsa|rsa

之后:

ssh批量分发

 

 

[[email protected] ~]$ ssh-copy-id -i .ssh/id_dsa.pub  -p 22 [email protected]  把公钥发到107上

 

ssh批量分发

 

ssh批量分发

 

分发简单脚本:

#!/bin/bash
if [ $# -ne 1 ]
then
   echo "Usage:/bin/sh $0 arg1"
exit 233
fi

for i in 7 8
        do
scp -P22 -rp $1  [email protected]192.168.0.10$i:~
done

          

 

 

ssh批量分发

 

 

分发hosts文件至多台机器:

ssh批量分发

(低版本的系统可能ssh远程执行命令 不能直接跟sudo,要加-t)

 

ssh批量分发

 

相关文章:

  • 2022-02-17
  • 2021-10-04
  • 2022-12-23
  • 2021-10-27
  • 2021-12-07
  • 2022-02-25
  • 2021-07-18
  • 2022-12-23
猜你喜欢
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-11-27
相关资源
相似解决方案