Install sshpass Tool on ENV

Install sshpass Tool on ENV

Install on MAC
>wget https://gigenet.dl.sourceforge.net/project/sshpass/sshpass/1.06/sshpass-1.06.tar.gz

Unzip the file and configure make and make install. Here is how to verify the installation
> 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.

Install on CentOS
follow the same steps and commands.

Install On RaspberryPI
follow the same steps and commands

Docker ENV
+#install sshpass
+RUN                 curl -O https://gigenet.dl.sourceforge.net/project/sshpass/sshpass/1.06/sshpass-1.06.tar.gz
+RUN                 tar zxvf sshpass-1.06.tar.gz
+WORKDIR        /install/sshpass-1.06
+RUN                 ./configure
+RUN                 make && make install
+WORKDIR        /install/

We can execute command similar to this without prompt password
>sshpass -p xxxxx sftp -o StrictHostKeyChecking=no [email protected]:upload/test.xml ./4625.xml

References:
https://sourceforge.net/projects/sshpass/?source=typ_redirect
https://gist.github.com/arunoda/7790979
https://linux.cn/article-8086-1.html

你可能感兴趣的:(Install sshpass Tool on ENV)