200  字
  1  分钟 
  macOS 安装 sshping 
 sshping 目前有:
- Rust 重写版(维护活跃,带 Homebrew tap 和 crates.io 包)
- 原始 C++ 版(仍可正常编译)
Rust 版本
cargo
cargo install sshping
# 自动放到 ~/.cargo/bin,记得加 PATHsshping -VHomebrew Tap
已静态链接 OpenSSL,无需额外依赖;支持 Apple Silicon 与 Intel。
brew tap TeddyHuang-00/appbrew install sshpingsshping -VRust 重写版维护者同时维护 tap,更新与 GitHub Releases 同步。
原始版
安装
1.安装依赖
brew install libssh2.拉取并编译
git clone https://github.com/spook/sshping.gitcd sshping
# Intel Mac(/usr/local)通常直接 OKmake
# Apple Silicon:libssh 头文件在 /opt/homebrewmake LIBSSH_INCLUDE=/opt/homebrew/include/libssh/libssh.h3.安装执行文件
sudo cp bin/sshping /usr/local/bin/4.验证
sshping -h常见报错与解决
| 报错/现象 | 原因 | 解决 | 
|---|---|---|
| libssh/libssh.h not found | Apple Silicon 默认路径不符 | make LIBSSH_INCLUDE=/opt/homebrew/include/libssh/libssh.h | 
| ld: library not found for -lssh | libssh 未链接 | brew link libssh 或检查 LIBRARY_PATH | 
参考链接
- Rust 版源仓库 https://github.com/TeddyHuang-00/sshping
- crates.io 包 https://crates.io/crates/sshping
- 原始 C++ 版 https://github.com/spook/sshping
 macOS 安装 sshping 
  https://blog.lpkt.cn/posts/macos-install-sshping/     
  