首页 > 其他分享 >8、change_root_password

8、change_root_password

时间:2023-02-09 03:11:17浏览次数:37  
标签:ENV echo sshpass PASS NET password root change


#!/bin/bash
rpm  -q sshpass  &>  /dev/null  || yum  -y  install  sshpass
export  SSHPASS=1
NET=10.0.0
for i  in   {1..7};do
      {
	  PASS=`openssl  rand  -base64  9`
	  sshpass  -e   ssh   -o  StrictHostKeyChecking=no  $NET.$i  "echo  $PASS|passwd  --stdin root  &> /dev/null
	  echo $NET.$i:$PASS  >>  host.txt
	  }&
done
wait



export SSHPASS=1
sshpass -e ssh -o StrictHostkeyChecking=no 10.0.0.7
ENV=`openssl rand  -base64  9`
echo  $ENV |passwd --stdin root
echo $ENV  >> HOST.TXT

标签:ENV,echo,sshpass,PASS,NET,password,root,change
From: https://www.cnblogs.com/zikang/p/17103942.html

相关文章