备忘,安装并使用 sshpass -p ‘654321‘ ssh hanmeimei@10.20.30.40

1,MacOS 安装 sshpass

前置条件,先安装 brew:

$ xcode-select --install
$ curl -O https://raw.githubusercontent.com/Homebrew/install/master/install.sh
$ chmod +x install.sh
$ ./install.sh

安装 sshpass:

$ brew search sshpass

$ brew install sshpass

验证:

使用

sshpass -p '1234' ssh hanmeimei@10.20.30.40

保存进脚本:

ssh10203040.sh

#!/bin/bash

sshpass -p '1234'    ssh  hanmeimei@10.20.30.40

chmod u+x ssh10203040.sh

登陆:

./ssh10203040.sh

2,ubuntu 安装 sshpass

apt-cache search sshpass

sudo apt install sshpass

使用方式同1.

相关推荐
菠菠萝宝2 天前
【Java八股文】08-计算机网络面试篇
java·计算机网络·http·面试·https·udp·tcp
电子阿板5 天前
ZYNQ TCP Server PS端千兆网口速率低问题,要修改BSP中LWIP配置参数
嵌入式硬件·tcp/ip·fpga开发·tcp
Mysticbinary9 天前
BurpSuite重放发包的一些区别
并发·tcp·burp·发包
Golinie12 天前
【C++高并发服务器WebServer】-12:TCP详解及实现
服务器·c++·tcp·webserver
Ljw...1 个月前
TCP协议(网络)
网络·网络协议·tcp/ip·tcp·tcp协议
纵横驰骋的小野马1 个月前
桌面应用(wails)实现对等节点通信
服务器·wails·tcp·p2p·对等节点
hong_zc1 个月前
网络原理(三)—— 传输层 之 UDP 和 TCP协议
网络·网络协议·udp·tcp
Fofh_Stone1 个月前
新抓包工具使用体验
网络安全·ios·https·开发工具·tcp·抓包·windows抓包
打鱼又晒网2 个月前
linux网络 | http结尾、理解长连接短链接与cookie
linux·网络协议·http·tcp
李少兄2 个月前
文件传输协议:FTP、FTPS 和 SFTP
sftp·tcp·ftp·ftps