change_passwd.sh 定時任務 crontab -e ...
change_passwd.sh
#!/bin/sh /usr/bin/chattr -i /etc/passwd /etc/shadow /etc/group /etc/gshadow /usr/bin/echo `/usr/bin/date +%Y%m%d%w` |/usr/bin/awk -F '' '{print $1$5$9"Jack_Cui"$3$5$7}' |/usr/bin/passwd --stdin root /usr/bin/chattr +i /etc/passwd /etc/shadow /etc/group /etc/gshadow
定時任務 crontab -e
#change_passwd 0 10 10,25 * * /bin/sh /srv/change_passwd.sh >/dev/null 2>&1