#! /Bin/bash
A = "192.168.0.200"
B = "192.168.0.203"
# Disable the key position signal
Trapper (){
Trap ":" int exit tstp term Hup
}
While:
Do
Trapper
Clear
Cat <menu
1) Web $
2) Web $ B
3) Exit
menu
Read-P "Please input your choice number:" Num
case "$ num" in
1)
SSH 192.168.0.200
;
2)
SSH 192.168.0.203
;
3 | *)
exit
esac
done
~
This script is used to control the operation staff to directly connect to the application server and use an intermediate server to directly manage connections. First, ssh-keygen must be used on the intermediate server to generate the public key and private key, send the public key to each application server. Because the User Name of the application server does not have a password, direct access is controlled and can be connected using the public key. The user permissions granted by the administrator must be common user permissions. Therefore, you must set the script information to pop up when a common user logs on to the intermediate server, you cannot perform other operations (trapper Control) on the script except for the operation information prompted by the script. You can set an environment variable file Vim/etc/profile. d/tiaoban. sh, write: [$ UID-Ne 0] & source/etc/service/scripts/tiaoban. sh.
Stepping Stone script