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 [端口]
相关推荐
汤姆yu1 小时前
Mac 上 2026 版 OpenClaw 安装与配置全流程
macos·openclasw安装
MonkeyKing_sunyuhua2 小时前
K8S执行MAC打出的本地镜像错误:exec /usr/local/bin/uvicorn: exec format error
macos·容器·kubernetes
小路恢弘7 小时前
xcode替换LLVM插件
ide·macos·xcode
ChengQianO8 小时前
从 0 开始:Mac 下 UTM 虚拟机安装 ROS Noetic(Ubuntu 20.04)
linux·ubuntu·macos
草帽lufei11 小时前
macOS中的Cursor等软件突然不能用了
macos·cursor
Rabbit_QL11 小时前
【Warp+Claude】任务完成自动通知(macOS + Warp 版)
macos·策略模式
X档案库12 小时前
【ROS2】Mac M4 虚拟机 Ubuntu 24.04 安装 ROS2 Jazzy 新手教程
macos·机器人·ros
江城月下13 小时前
从零开始:我在 Mac M1 上搭建离线 AI 知识库的实战记录
人工智能·macos
掘根1 天前
【即时通讯项目】环境搭建9——语言平台
ide·macos·xcode
帅得不敢出门2 天前
MacOS安装VSCode在QEMU上模拟跑FreeRtos
ide·vscode·macos·freertos·rtos