当前位置: 代码迷 >> 综合 >> MacOS Terminal 安装 sshpass
  详细解决方案

MacOS Terminal 安装 sshpass

热度:5   发布时间:2024-03-07 07:18:06.0

前提:安装Xcode Command Line
https://developer.apple.com/download/more/
下载Xcode Command Line =》安装
Command Line Tools fro Xcode 12.1 GM seed
正文开始:

1、sshpass安装

直接用以下命令不行,会失败

brew install https://raw.githubusercontent.com/eugeneoden/homebrew/eca9de1/Library/Formula/sshpass.rb
#OR
brew install sshpass

用下面的命令可以安装sshpass

brew create http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.06.tar.gz --force
brew install sshpasss

2、sshpass使用

sshpass -p my_password ssh m_username@hostname
#例如
sshpass -p 123465 ssh ping@172.28.199.241
#跳过yes/no输入
sshpass -p 123465 ssh -o StrictHostKeyChecking=no ping@172.28.199.241
  相关解决方案