文章 89
评论 0
浏览 461457
SSH认证脚本

SSH认证脚本

#要认证的主机IP
IP="
192.168.10.182
"
#centos开启
#rpm -q sshpass &>/dev/null || yum -y install sshpass

#ubuntu开启
dpkg -L sshpass &>/dev/null || apt -y install sshpass
[ -f /root/.ssh/id_rsa ] || ssh-keygen -f /root/.ssh/id_rsa -P ''
#登录密码
export SSHPASS=123456
for HOST in $IP;do
     sshpass -e ssh-copy-id -o StrictHostKeyChecking=no $HOST
done

标题:SSH认证脚本
作者:Carey
地址:HTTPS://zhangzhuo.ltd/articles/2021/05/17/1622600900279.html

生而为人

取消