sshpass安装以及使用

centos7如何安装sshpass

 

  1. 先安装epel

    yum install -y epel-release

    yum repolist

  2. 安装完成epel之后,就可以按照sshpass了

    yum install -y sshpass

  3. 验证:sshpass -V
  4. [root@hostuser ~]# sshpass -V
    sshpass 1.06
    (C) 2006-2011 Lingnu Open Source Consulting Ltd.
    (C) 2015-2016 Shachar Shemesh
    This program is free software, and can be distributed under the terms of the GPL
    See the COPYING file for more information.
    
    Using "assword" as the default password prompt indicator.
    [root@hostuser ~]#
    

      使用方法

    sshpass -p "yourpassword" ssh  yourusername@ip 等价于  ssh root@ip   再输入密码
    

      当远程主机端口不再是22默认端口时候:

  5. sshpass -p "password" ssh -p  8443  username@ip
    

      

转载于:https://www.cnblogs.com/SunshineKimi/p/10891428.html

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值