We have isolated servers when I need to enable/disable access to the server through jump host when admin requested.
I am using openssh-server-8.9 on all machines and the client and server are using Ubuntu 22 .04 operating system.
For example, If the admin requested to enable S1 access and disable S2 and S3 access.
Currently,
I am copying the public key of the
jump hostto the S1 server intoauthorized_keysandusing awk/sed to remove the public key of the
jump hostinauthorized_keysin the other two serversUpdate
/etc/ssh/ssh_configwith jump host.
Is there any best approach to automate this procedure in an effective way?
+---------------+
| |
| |
| |
+--------------> |
| | S1 Server |
| | |
| | |
| +---------------+
|
+-----------------+ +------------------+ |
| | | | |
| | | | | +--------------+
| Client | | | | | |
| +-------------->| Jump Host +-------+ | |
| | | | | | |
| | | | | | |
+-----------------+ +------------------+ | | S2 Server |
+----------------> |
| | |
| | |
| +--------------+
|
|
|
| +--------------+
| | |
| | |
| | |
| | |
| | S3 Server |
| | |
+-----------------> |
| |
| |
+--------------+