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
相关推荐
lcreek6 小时前
Linux信号机制详解:阻塞信号集与未决信号集
linux·操作系统·系统编程
shandianchengzi6 小时前
【记录】Tailscale|部署 Tailscale 到 linux 主机或 Docker 上
linux·运维·docker·tailscale
John Song7 小时前
Linux机器怎么查看进程内存占用情况
linux·运维·chrome
sichuanwuyi7 小时前
Wydevops工具的价值分析
linux·微服务·架构·kubernetes·jenkins
持戒波罗蜜8 小时前
ubuntu20解决intel wifi 驱动问题
linux·驱动开发·嵌入式硬件·ubuntu
不做无法实现的梦~8 小时前
使用ros2来跑通mid360的驱动包
linux·嵌入式硬件·机器人·自动驾驶
点云SLAM8 小时前
C++内存泄漏检测之Windows 专用工具(CRT Debug、Dr.Memory)和Linux 专业工具(ASan 、heaptrack)
linux·c++·windows·asan·dr.memory·c++内存泄漏检测·c++内存管理
肉肉心很软8 小时前
使用onlyoffice实现文件预览编辑 + Docker一键部署流程
运维·docker·容器
LuiChun8 小时前
Docker Compose 容器服务查询与文件查看操作指南(Windows Docker Desktop 版)【一】
linux·运维·windows·docker·容器
${王小剑}8 小时前
在离线ubuntu上布置深度学习环境
linux·运维·ubuntu