AutoSSH

平时接触最多的就是登录服务器操作,由于安全问题,自己的密码都是非常复杂的。每次输入密码都是一个繁琐的过程。而且公司内部网络有堡垒机,更是繁琐。为减少在这类情况下浪费的时间,于是开发了AutoSSH

Introduction

Auto Login SSH Server (expect-based)

Install

$ git clone https://github.com/wufeifei/autossh.git
$ sudo cp autossh/autossh /usr/local/bin/

Config

$ cat ~/.autosshrc
sername|192.168.1.110|root|password|port|is_bastion  
wufeifei|wufeifei.com|root|password|22|1  

Usage

$ autossh
############################################################
#                     [AUTO SSH]                           #
#                                                          #
#                                                          #
# [1] 192.168.1.110:feei                                   #
# [2] 10.11.2.103:root                                     #
# [3] 103.21.140.84:root                                   #
#                                                          #
#                                                          #
############################################################
Server Number:(Input Server Num)  

OR

$ autossh 1

OR Bastion Host

$ autossh 1 10.12.0.123

Auto SUDO

$ autossh 1 10.11.0.123 sudo

Source