sehll脚本如下:

#!/bin/bash
#实现简单的跳板机功能
#忽略键盘输入信号防止ctrl+c退出
trap '' INT QUIT TSTP TERM HUB

menu(){

cat << EOF

----------------------------------

1.192.168.205.205

2.192.168.205.200

3.退出

----------------------------------
EOF
}

while true
do
clear
menu
read -p "please select an item(1-5):" select
case $select in
1)
ssh $USER@192.168.205.205 ;;
2)
ssh $USER@192.168.205.205 ;;
3)
exit 0

*)
read -p "please select an item(1-5):"
esac
done

将脚本放到/etc/profile.d目录下 只要登录就会执行脚本