zl程序教程

您现在的位置是:首页 >  后端

当前栏目

Shell批量SSH免交互登录认证

ssh批量认证shell 登录 交互
2023-09-14 08:59:44 时间
#!/bin/bash # Description: configuration local host and remote host ssh keypair authentication, Support Ubuntu and CentOS operation system. # Blog: http://lizhenliang.blog.51cto.com function color_echo() {
                color_echo green "The $PKG_NAME installation failure! Try to install again."
                [ $(check_pkg $PKG_NAME) == "no" ]   color_echo red "The $PKG_NAME installation failure!"   exit 1
                color_echo green "$PKG_NAME installation failure! Try to install again."
                [ $(check_pkg $PKG_NAME) == "no" ]   color_echo red "The $PKG_NAME installation failure!"   exit 1
        color_echo green "The public/private rsa key pair not exist, start Generating..."
elif [[ $1 =~ ^[a-z]+@[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}-[0-9]{1,3}@.* ]]; then
    echo "Example3: $0 [root@192.168.1.10@password root@192.168.1.11@password root@192.168.1.12@password ...]"
李振良 6年互联网运维经验,擅长Linux,Python,Docker,MySQL,运维自动化等技术领域。