SSHPASS

作者: 王哲理 | 来源:发表于2017-09-18 09:53 被阅读21次

下载地址

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的三种用法,挺方便的。推荐 !!!

相关文章

网友评论

      本文标题:SSHPASS

      本文链接:https://www.haomeiwen.com/subject/fmmvsxtx.html