Linux 跳板机脚本
先生成和分发秘钥:
ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
ssh-copy-id -i .ssh/id_dsa.pub centos2
ssh-copy-id -i .ssh/id_dsa.pub centos2
编写脚本 tiaoban.sh
#!/bin/sh function trapper(){ trap '' INT QUIT TSTP TERM HUB } function menu(){ cat <<EOF ==============Host List============== 2-centos2 3-centos3 0-Exit system ===================================== EOF } function host(){ case "$1" in 2) ssh $USER@centos2 ;; 3) ssh $USER@centos3 ;; 0) exit 0 esac } function main(){ while true do trapper clear menu read -p "Pls input your choice:" num host $num done } main
相关推荐
projava 2020-11-14
WanKaShing 2020-11-12
airfish000 2020-09-11
tryfind 2020-09-14
yegen00 2020-09-10
kkaazz 2020-09-03
风语者 2020-09-02
BraveWangDev 2020-08-19
lichuanlong00 2020-08-15
gsl 2020-08-15
pandaphinex 2020-08-09
yhuihon 2020-08-09
CheNorton 2020-08-02
xiangqiao 2020-07-28
hpujsj 2020-07-26
hpujsj 2020-07-26
sshong 2020-07-19
BraveWangDev 2020-07-19
annan 2020-07-18