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