0

Ok so I've done a bit of googling and haven't come across an answer.

We have multiple servers in our environment and around 5 infrastructure servers.

Then we have one server that we can ssh to all the normal servers.

Now I want to create unique ssh key's for each individual infrastructure server, so that they cannot be accessed with the default ssh key.

The aim is to be able to specify which ssh key to use for which infrastructure server on the command line while sshing to the infrastructure server.

I am not sure where to start and do not want to interfere with the trust for the normal servers.

Can anyone point me in the right direction?

Thanks in advance!

davemx_5
  • 1
  • 2

2 Answers2

0

I guess you can just do something like "ssh user@server 'ssh -i /path/to/pubkey user@server2'" and create aliases to that command to make it easier to work with.

Jeroen
  • 1,341
  • 7
  • 16
0

Ok so what I am is creating a folder named "infra1" then store the relative new ssh key pair in that folder. And pass the key to the authorized key file on "infra1".

That way I avoid groups and not as easy to just ssh as normal to an infrastructure server.

"ssh -i /root/.ssh/infra/InfraServer1/Infraserver1 Infraserver1"

Thanks for the help Jeroen!

davemx_5
  • 1
  • 2