目录

一、安装brew工具

二、安装sshpass工具

三、安装sshpass补充说明


一、安装brew工具

# 国内可用的一键安装脚本 
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

二、安装sshpass工具

1、安装sshpass

注意:Mac不允许直接通过brew install sshpass安装sshpass,请通过下面的脚本安装,代码保存为sshpass.rb(Rubby文件),然后通过brew install sshpass.rb安装即可。

(1)新建文件、并打开的命令

touch sshpass.rb 
open -e sshpass.rb

(2)将下面代码copy进去

require 'formula'

class Sshpass < Formula
  url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz'
  homepage 'http://sourceforge.net/projects/sshpass'
  sha256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60'

  def install
    system "./configure", "--disable-debug", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    system "make install"
  end

  def test
    system "sshpass"
  end
end

(3)保存并退出,然后执行文件

brew install sshpass.rb

三、安装sshpass补充说明

在执行过程中,有的小伙伴无法安装(如下图),在此可以使用以下方法

1、首先将sshpass-1.06.tar.gz文件下载下来,在浏览器中打开以下地址

Download Non-interactive ssh password auth from SourceForge.nethttp://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz

2、解压sshpass-1.06.tar.gz文件

tar -zxvf sshpass-1.06.tar.gz     

3、进入config目录下,并执行以下命令

4、最后在检查,是否安装成功,出现下图说明安装成功(4句命令

./configure
make install
sshpass
sshpass -V

GitHub 加速计划 / br / brew
40.4 K
9.47 K
下载
🍺 The missing package manager for macOS (or Linux)
最近提交(Master分支:1 个月前 )
90a90b30 1 个月前
47b1cab7 1 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐