

host_list=(192.168.6.3 192.168.6.7 192.168.6.5)
for host in ${host_list[@]}
do
   echo "current host is $host"
   ssh -p 2022 root@"$host" "cp /etc/ssh/sshd_config /etc/ssh/sshd_config_zyly"
   scp -P 2022 /etc/ssh/sshd_config root@"$host":/etc/ssh/sshd_config
   ssh -p 2022 root@"$host" "systemctl restart sshd"
   echo ""

done

