Mac 手动安装 sshpass

1. 下载安装包

https://sourceforge.net/projects/sshpass/
在这里插入图片描述

解压并进入到安装包目录

tar -zxvf sshpass-xx.xx.tar.gz
cd sshpass-xx.xx

2. 检验环境,编译源码安装

./configure

make&&make install

3. 检测安装是否成功

▶ sshpass
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

4. 使用

sshpass -p [密码] ssh [用户名]@[服务器地址] -p [端口]

猜你喜欢

转载自blog.csdn.net/w_monster/article/details/132722794
今日推荐