CentOS7编译安装sshpass过程

环境说明:centos 7

cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

我的sshpass版本

sshpass-1.06.tar.gz

编译安装需要先下载sshpass-1.06.tar.gz软件压缩包到linux主机上然后解压

tar -xvf sshpass-1.06.tar.gz

然后查看当前目录下生成sshpass-1.06目录,切换进入

cd sshpass.1

查看当前目录下文件

ls
aclocal.m4  compile      config.log     configure.ac  INSTALL     main.o       Makefile.in  README     stamp-h1
AUTHORS     config.h     config.status  COPYING       install-sh  Makefile     missing      sshpass
ChangeLog   config.h.in  configure      depcomp       main.c      Makefile.am  NEWS         sshpass.1

 先安装编译环境

yum -y install gcc gcc-c++ make zlib-devel pcre pcre-devel openssl-devel

  然后开始编译安装

./configure   #也可以指定安装路径,我这里使用默认

make && make install

 安装成功后查看

which sshpass

/usr/local/bin/sshpass

  测试使用

sshpass -p password ssh username@xxx.xxx.xxx..xxx

  

原文地址:https://www.cnblogs.com/fusheng11711/p/10874106.html