mac 下载使用sshpass+命令起别名

1.下载homebrew

复制代码
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

2.创建 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

3.在sshpass.rb的同目录下执行安装命令

复制代码
brew install sshpass.rb

命令起别名

mac

复制代码
vim ~/.bash_profile
alias ymq='sshpass -p r00tme ssh root@xxx.xx.x.xx'
source ~/.bash_profile

linux

复制代码
vim ~/.bashrc
alias auth='代替带的命令'
source ~/.bashrc
相关推荐
棒棒的唐37 分钟前
armbian平台ubuntu环境下telnet安装及启动,给pantherX2增加一个应急通道
linux·运维·armbian·telnetd
bug攻城狮38 分钟前
CentOS 7 设置静态 IP 地址
linux·tcp/ip·centos
纳切威1 小时前
CentOS 7部署Zabbix5.0
linux·运维·centos·zabbix
sunshine-sm1 小时前
CentOS Steam 9安装 MySQL 8
linux·运维·服务器·数据库·mysql·centos·centos stream
bug攻城狮1 小时前
CentOS 7 快速检查软件包是否已安装的5种方法
linux·运维·centos
男孩李1 小时前
浅谈代理流程自动化 (APA)
运维·人工智能·自动化
尚久龙1 小时前
安卓学习 之 用户登录界面的简单实现
android·运维·服务器·学习·手机·android studio·安卓
high20112 小时前
【 运维相关】-- HTTP 压测/负载发生器之新秀 oha
运维·网络协议·http
DONG9992 小时前
ubuntu 22 安装轻量级桌面Xfce并使用xrdp远程桌面连接
linux·运维·ubuntu
帅得不敢出门2 小时前
macOS苹果电脑运行向日葵远程控制软件闪退
windows·macos·远程控制·向日葵