• SSHPASS


    下载地址

    start install: 

    yum -y install wget

    wget    https://jaist.dl.sourceforge.net/project/sshpass/sshpass/1.06/sshpass-1.06.tar.gz

    tar  -xf  sshpass-1.06.tar.gz

    cd  sshpass-1.06

    ./configure

    make && make install


    use:


    num 1:

    sshpass   -V                     ----使用帮助

    sshpass   -p   '123'    ssh   root@192.168.3.66   'df -lh'                   ----( -p ) 直接输入密码


    num 2:

    vim /etc/profile

    export     SSHPASS='123'                       ----使用局部环境变量

    echo $SSHPASS

    source    /etc/profile            ---配置生效

    sshpass  -e   ssh   root@192.168.1.43     'df -lh'


    num 3:

    vim num3                ----将密码放入文件num3

    cat num3

    123

    sshpass   -f   alex    ssh    root@192.168.1.43 'll'                       ---(-f) 读取num3中的密码


    以上是sshpass的三种用法,挺方便的。推荐 !!!

  • 相关阅读:
    力扣背包型动态规划
    并查集
    位运算题目
    随机采样题目
    单调栈题目
    前缀和题目
    贪心题目
    堆排序
    python装饰器
    状态机题目
  • 原文地址:https://www.cnblogs.com/alex-note/p/7146529.html
Copyright © 2020-2023  润新知