#!/bin/bash
#
#********************************************************************
#Author: chenjiahao
#QQ: 1938191576
#Date: 2022-08-18
#FileName: ssh.sh
#URL: https://www.placjh.com
#Description: The test script
#Copyright (C): 2022 All rights reserved
#********************************************************************
ssh='
10.0.0.11
10.0.0.12
10.0.0.13
10.0.0.14
'
ssh-keygen
wait
rpm -q sshpass &>/dev/null ||yum -y install sshpass &>/dev/null
sshpass -p 123456 ssh-copy-id -o StrictHostKeyChecking=no 127.0.0.1
wait
for i in ${ssh};do
{
sshpass -p 123456 scp -pro StrictHostKeyChecking=no ~/.ssh $i:~/ &>/dev/null
}&
done
wait
Linux基于key验证
于 2022-12-15 22:09:20 首次发布