安装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 ...
随机推荐
- springboot内置分页技术
1,在pom.xml中注入分页的配置 <dependency> <groupId>com.github.pagehelper</groupId> <artif ...
- vue-cli3.0 初体验
vue-cli3.0 自我记录 其实在2018年8月10号,vue-cli3.0就已经面世了,由于项目中应用的全是2.x版本,所以并不了解3.0的vue-cli发生了什么变化,那今天尝试了下遇见的问题 ...
- AB窗体互传参数本质
一.找了好几个,都不靠谱,不是说不靠谱,自己感觉太繁琐,根本就是本窗体的属性(对象)的传递,1实例化2把实例化后的窗体属性=本窗体的对象 二.传递的的时候都是在互相引用的时候传递,推荐的个人认为最简单 ...
- Android中的asserts和res/raw资源目录
1.assets目录 assets目录下称为原生文件,无法通过R资源清单类访问,这类文件在被打包成apk文件时是不会进行压缩的: (1)使用方法 AssetManager assets = this. ...
- 用PHP自带函数对二维数组进行排序
经常会面临这样的需求,虽然有时候我们可以在数据库查询的时候,直接对数据进行排序,但还是无法满足日益复杂的业务需求. 这里边会用到两个函数 一个是array_column()函数,这个函数接受三个参数. ...
- redis 的使用 及 配置文件解读
redis-server命令 redis-server /usr/local/redis/conf/redis.conf #加配置文件绝对路径启动redis服务 redis-server /usr/l ...
- 03 MySQL之数据类型和运算符
01-数据类型 MySQL支持多种数据类型,主要有 数值类型.日期/时间类型和字符串类型. 1.1 整数类型 1.2 浮点数类型和定点数类型 单精度浮点类型(FLOAT)和双精度浮点类型 (DOUBL ...
- kubernetes发布tomcat服务,通过deployment,service布署(转)
1.制作tomcat镜像 参考docker tomcat镜像制作 此处直接拉取 查看已有可镜像 先设置docker阿里源,即添加 "registry-mirrors": [&quo ...
- java1.7新特性:try-with-resources
转载:https://blog.csdn.net/fanxiaobin577328725/article/details/53067163 首先看代码: import org.junit.Test; ...
- js如何控制select展开
找了一圈也没找到靠谱的方案,后来通过动态的控制select的size属性实现了. 这也算是一种方法吧. 先判断option的数量n,然后把select的size调整到n,当用户选择后,再把size设置 ...