#!/usr/bin/bash
#jumpserver
trap "" HUP INT OUIT TSTP
clear
while :
do
webserver=192.168.117.101
mysql=192.168.117.102
cat <<-EOF
1.WEB
2.MYSQL
EOF
read -p "input number: " num
case "$num" in
1) ssh [email protected]$webserver
;;
2) ssh [email protected]$mysql
;;
*) echo "error"
;;
esac
done
修改lx .bash_profile或者bashrc等,让sh文件开机执行
ssh生成密钥
[[email protected] ~]$ ssh-keygen
[[email protected] ~]$ ssh-copy-id 192.168.117.101
原文地址:http://blog.51cto.com/13620507/2126139
时间: 2024-10-14 06:50:58