You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
218 B

  1. #!/bin/bash
  2. set -e #如果某条指令执行出错,则会退出脚本
  3. if [ $# -eq 0 ]; then
  4. echo "Usage: $0 <ip>"
  5. exit 1
  6. fi
  7. # 清除目标主机的ssh-key
  8. ip=$1
  9. ssh root@${ip} "rm -rf ~/.ssh/authorized_keys"