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 [端口]
相关推荐
AirDroid_cn2 小时前
系统终端与iTerm2字体看起来不一样?macOS Sequoia统一渲染指南
macos
JiaWen技术圈6 小时前
2026 年的 macOS 磁盘清理方法
macos
lichong9516 小时前
让AI自己用电脑!Cua:后台操作鼠标键盘,Mac/Windows/Linux全支持
人工智能·macos·ai·计算机外设·agent·提示词
A尘埃7 小时前
批处理命令(Linux/Mac、Windows项目启动脚本)
linux·windows·macos
他们都不看好你,偏偏你最不争气1 天前
【iOS】Runtime - Part 2 && 消息发送:缓存、查找与转发
macos·ios·objective-c·cocoa
Deepzz1 天前
macOS 上调教第三方鼠标的一些经验:从滚动顺滑到输入法自动切换
macos·swift·鼠标
whyfail1 天前
Colima:把 Docker Desktop 从 Mac 上“瘦身”的那把刀
macos·docker·容器
他们都不看好你,偏偏你最不争气1 天前
【iOS】Runtime - Part 1 && 对象与类的本质
macos·ios·objective-c·cocoa
Shacoray1 天前
Mac 向 Windows 局域网传文件方案整理
windows·macos