安装sshpass
sshpass: 用于非交互的ssh 密码验证
安装sshpass
curl -O -L http://downloads.sourceforge.net/project/sshpass/sshpass/1.06/sshpass-1.06.tar.gz && tar xvzf sshpass-1.06.tar.gz && cd sshpass-1.06 && ./configure && make && sudo make install
安装后执行sshpass -V查看版本
sshpass -V
sshpass 1.06
(C) - Lingnu Open Source Consulting Ltd.
(C) - 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.
sshpass -h查看帮助
Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
-f filename Take password to use from file
-d number Use number as file descriptor for getting password
-p password Provide password as argument (security unwise)
-e Password is passed as env-var "SSHPASS"
With no parameters - password will be taken from stdin -P prompt Which string should sshpass search for to detect a password prompt
-v Be verbose about what you're doing
-h Show help (this screen)
-V Print version information
At most one of -f, -d, -p or -e should be used
sshpass 参数 SSH命令(ssh,sftp,scp等)。
参数:
-p password //将参数password作为密码。
-f passwordfile //提取文件passwordfile的第一行作为密码。
-d 使用数字作为文件描述符来获取密码
-e //将环境变量SSHPASS作为密码。
另外,对于ssh的第一次登陆,会提示:“Are you sure you want to continue connecting (yes/no)”,这时用sshpass会不好使,可以在ssh命令后面加上 -o StrictHostKeyChecking=no来解决。比如说上面的命令,就可以写作ssh -p efghi scp abc@192.168.0.5:/home/xxx/test /root -o StrictHostKeyChecking=no。
安装sshpass的更多相关文章
- mac使用brew安装sshpass
brew安装sshpass brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Form ...
- ansible 提示安装sshpass
之前用ansible一直用的root身份.机器之间又早早的做好了ssh信任.所以一直也没有出现什么问题.今天想想自己不能这么浪了,还是用回普通用户吧: 然而马上就遇到了第一个问题,ansible提示安 ...
- 安装sshpass:No package sshpass available
安装sshpass的时候,报了如下错误: No Package sshpass available 更改软件源之后也无效.直到看到StackOverFlow上的一个问题:https://stackov ...
- MacOS Mojave 安装sshpass
使用sshpass的场景 安装sshpass及各种常见小问题处理 测试 安全提示 使用sshpass的场景 在MacOS下使用ansible命令(inventory文件中使用了密码验证的方式)或者使用 ...
- CentOS7编译安装sshpass过程
环境说明:centos 7 cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) 我的sshpass版本 sshpass-1.06. ...
- 苹果系统通过brew安装sshpass
默认使用brew install sshpass会出现Warning: MD5 support is deprecated and will be removedin a future version ...
- 安装 sshpass
https://www.cnblogs.com/lemon-le/p/6495007.html ssh远程执行命令并自动退出 https://blog.csdn.net/mjj291268154/ar ...
- brew安装sshpass
有以下解决方法: # 1 brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formu ...
- centos6安装sshpass
跳转机需要装这个 #!/bin/bash yum -y install gcc-c++ openssh-clients curl -o sshpass.tar.gz http://sourceforg ...
随机推荐
- Qt 单元测试
使用Qtcreator 自带的单元测试工具框架QTestlib进行测试. 一.创建一个单元测试程序 new project->other project ->Qt unit test ...
- Linux系统是否被植入木马的排查流程梳理
在日常繁琐的运维工作中,对linux服务器进行安全检查是一个非常重要的环节.今天,分享一下如何检查linux系统是否遭受了入侵? 一.是否入侵检查 1)检查系统日志 1 2 检查系统错误登陆日志,统计 ...
- docker部署多个mysql容器,并使用java连接
测试springboot多个数据源配置时,需要安装多个mysql容器,由于资源限制,当前只有一台虚拟机,如果在一台机器上安装多个mysql实例,是可以的,但步骤比较繁琐,使用docker来安装MySQ ...
- 记录一次webpack3升级到webpack4过程
升级之前也参考了一些网上的教程.借鉴之,进行的自己的升级.一些版本为什么设为那个版本号也是参考别人的结果. 整体是按照先升级npm run dev:在升级npm run build的顺序. 首先升级w ...
- ios-Runtime调用私有方法
有时在代码中会有需要调用私有方法的场景,如不想import太多头文件:想组件设计一些解耦的模块:查看别人模块中未暴露的代码进行分析等. 在 ios 中调用私有方法有很多种方式,主要是通过Runtime ...
- 从数组中找出所有组合为s的数
java版本 package numCombine; /** * 从数组中找出所有组合为s的数 * @author root * */ public class NumComberAll { publ ...
- 【Taro全实践】修改radio组件的大小
需求是将radio选中后颜色改为橙色.大小改成合适大小. 1.改颜色 <Radio color='#FF7464'></Radio> 2.改大小 <Radio style ...
- easuUI之datebox日期选择框
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <hea ...
- 深度学习之加载VGG19模型获取特征图
1.加载VGG19获取图片特征图 # coding = utf-8 import tensorflow as tf import numpy as np import matplotlib.pyplo ...
- 一个伪静态与404重定向例子(房产网),.htaccess文件内容
ErrorDocument 404 /404.phpRewriteEngine OnRewriteBase /RewriteRule ^(.*)\.(asp|aspx|asa|asax|dll|jsp ...