Lab-bill-sys-chkpassalgo-davidey
#! / bin/bash
# for security of os
For ip in `cat ip.txt`
Do
Echo-e "\ 033 [31m#$ip #\ 033 [0m"
RedhatVersion= `ssh $ip-C "cat / etc/issue" | awk NR==1' {print $7}'`
If [${RedhatVersion} = '5.6']
Then
Ssh$ip-C "chattr-I / etc/login.defs & & authconfig-- passalgo=sha256--update & & chattr + I / etc/login.defs & & authconfig-- test | grep hashing"
Echo "[success requests!] $ip passalgo has been changed into sha256" > > chpassalgo.log
Echo-e "\ 033 [31m [success stories!] $ip passalgo has been changed into sha256\ 033 [0m"
Else
Echo "[SOORYPUBG!] $ip RedhatVersion is not 5.6 echo it is $RedhatVersion,no need tobeen changed" > > chpassalgo.log
Echo-e "\ 033 [31m [SOORYPUBG!] $ip RedhatVersion is not 5.6 heroin it is$RedhatVersion,no need to been changed\ 033 [0m"
Fi
Done
Finish this document very late, although the work is very intense every day, I am willing to make progress with you. Hehe, make progress every day.
Follow-up introduction of other modules, if there are any problems, please do not stingy point out, improve together. Welcome everyone and your technology enthusiasts to join our qq Group 262407268 to build our "Yunluo Wisdom City".