SSH jump box with private keys on jump box

sshssh-keys

I basically want to do what is explained in this serverfault question, so I want a group of people ("admins") be able to login in to many hidden servers with ssh using a jumpbox which stores the private keys for the hidden servers.

As updating the authorized_keys on the hidden servers is rather expensive, I only want to control access to them by modifying the jumpbox, i.e. add or remove "admins" by changing the authorized_keys file on the jumpbox.

What I especially do not want is to leak the private keys stored on the jumpbox to the admins, so the ssh-agent+ProxyCommand approach mentioned in the linked question's answers won't work because the agent would send the private keys from the jumpbox to the "admins", if I understand that right.

On the contrary, simply doing

ssh -tt jumpbox ssh hidden_server_1

has the drawback that "admins" can't use scp and port forwarding easily.

NB: Shell access to the jumpbox shall be disabled for "admins" by using a custom script as login shell that only allows the necessary commands.

Is there any secure & convenient way to keep the comfort of scp and port forwarding without weakening the security constraints?

Thank you very much for your help!

Best Answer

It is not possible to "use" a private key without being able to read - and thus copy - that private key. So the idea that your admins can login to the jumpbox, then go onwards using a private key that they cannot directly access, is not going to fly.

But you can arrange things so that the private keys can only be used from the jumpbox (see man sshd, from= in AUTHORIZED_KEYS FILE FORMAT). Then, denying a given admin access to the jumpbox leaves him or her with keys that are of no further use.

Does that satisfy your security constraints?

Note that you write as if all remote admins were accessing a shared account on the jumpbox. If it were my system, I wouldn't do that; I'd have each remote admin have an individual account on the jumpbox, all such accounts having access to - or copies of - the relevant captive onward keypair. That makes revoking an individual admin's access to the jumpbox much easier and more reliable.