field=$(awk -F ':' '/^root/{print $2}' /etc/shadow)
password=$(openssl passwd -1 123456)
sed -i '/^root/s%'$field'%'$password'%' /etc/shadow
field=$(awk -F ':' '/^root/{print $2}' /etc/shadow)
password=$(openssl passwd -1 123456)
sed -i '/^root/s%'$field'%'$password'%' /etc/shadow
本文标题:忘记 root 密码修改 /etc/shadow 重置密码
本文链接:https://www.haomeiwen.com/subject/bszazdtx.html
网友评论