swan跳过手动输入密码

77 阅读1分钟

①借助brew安装 sshpass(可以直接使用文件的方式去下载),参考链接 sshpass.rb 内容如下:

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

执行命令安装: brew install sshpass.rb

②配置ggauth的环境变量,ggauth的mac包 ggauth

1.vim .bash_profile
填写内容如下:
GGAUTH=/Users/whoops/Desktop/tool/ggauth
export PATH=$PATH:$GoPath:$GGAUTH

2.source .bash_profile

image.png ③执行命令

sshpass -p "密码`ggauth google秘钥`" ssh 账号@***.com