Mac 手动安装 sshpass

1. 下载安装包

https://sourceforge.net/projects/sshpass/

解压并进入到安装包目录

sh 复制代码
tar -zxvf sshpass-xx.xx.tar.gz
cd sshpass-xx.xx

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

sh 复制代码
./configure

make&&make install

3. 检测安装是否成功

sh 复制代码
▶ 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. 使用

sh 复制代码
sshpass -p [密码] ssh [用户名]@[服务器地址] -p [端口]
相关推荐
蜜汁小强14 分钟前
macOS 上卸载并重新安装HomeBrew
macos
新手村领路人17 分钟前
macOS 原生自带的缩放功能设置
macos
小胖燕2 小时前
macOS 系统本地部署 CVAT 进行数据标注
macos·cvat
海棠AI实验室2 小时前
第 3 篇:服务编排与自启动——把 Mac 变成“稳定可运维”的家庭 AI 机房
运维·人工智能·macos
蜜汁小强3 小时前
macOS 上管理不同版本的python
开发语言·python·macos
Edward.W4 小时前
iOS 17+真机命令行操作对照表
macos·ios·cocoa
1telescope1 天前
MacBook 安装 nvm 管理 Node.js 多版本教程
macos·node.js
1telescope1 天前
MacBook 安装 Oh My Zsh 完整教程
macos·mac
蜜汁小强1 天前
macOS 上的git代理配置在哪里
git·macos·代理模式·proxy模式
蜜汁小强1 天前
macOS 上升级到 python 3.12
开发语言·python·macos