安装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 ...
随机推荐
- Nslookup: command not found error on RHEL/CentOS 7
Reference: https://unix.stackexchange.com/questions/164210/nslookup-command-not-found-error-on-rhel- ...
- synchronized对象解析
package com.haiyisoft.hyoaPc; public class Test7 { public static void main(String[] args) throws Int ...
- H5和原生APP之间的区别
最近项目中因各种客观因素,移动端都是默认用的纯H5 APP,感受最深的就是各种坑啊,好大的坑啊.产品上线后,带着各种坑后的总结原因方发现很多人都说纯H5 APP一次编写就能支持android和IOS两 ...
- 终端less命令执行完之后怎样退出
Linux中的less命令主要用来浏览文件内容,与more命令的用法相似,不同于more命令的是,less命令可往回卷动浏览以看过的部分,less 的用法比起 more 更加的有弹性.如果想退出les ...
- flutter webview_flutter 设置cookies
WebViewController _controller; onWebViewCreated: (WebViewController wvc) { _controller = wvc; } onPa ...
- elasticsearch 常用查询 + 删除索引 + 集群状态诊断
1.多条件查询 curl -X POST \ http://10.0.0.42:9200/addressbook_user/_search \ -H 'cache-control: no-cache' ...
- Mac 每次重启终端后配置的不生效.需要重新source
Mac 每次都要执行source ~/.bash_profile 配置的环境变量才生效 自己在 ~/.bash_profile 中配置环境变量, 可是每次重启终端后配置的不生效.需要重新执行 : $s ...
- day36 joinablequeue、多线程理论、多线程的两种使用方式、守护线程、互斥锁、死锁、递归锁、信号量
1.joinablequeue队列 joinablequeue与queue一样,也是一种队列,其继承自queue,也有queue中的put 与get 方法,但是在joinablequeue中有自己的 ...
- MySQL_数据表命令
目录 数据表操作 1.创建数据表: 2. 修改表结构: 数据表查看 1.查看数据库中所有表的信息 2.查看表结构 3.查看创建表时所输入的命令 4.删除数据表 数据表操作 关于Mysql的数据类型,点 ...
- 自学电脑游戏第四天(Swing)
继续之前的 3.组合框(JComboBox) 例题:利用JComboBox设计一个选择城市的程序. import java.awt.*; import javax.swing.*; public cl ...