很多MJJ喜欢参与群内免费服务器的争夺但是苦于每次修改密码都会有其他用户再次修改密码于是这里给出一行命令用于修改root密码和踢出所有有密码修改权限的用户强行中断其会话
current_tty=$(tty); pts_list=$(who | awk '{print $2}'); for pts in $pts_list; do if [ "$current_tty" != "/dev/$pts" ]; then pkill -9 -t $pts; fi; done; echo 'root:NEW_PASSWD' | chpasswd && sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config && systemctl restart sshd.service; current_tty=$(tty); pts_list=$(who | awk '{print $2}'); for pts in $pts_list; do if [ "$current_tty" != "/dev/$pts" ]; then pkill -9 -t $pts; fi; done