I have the following situation and want to know what are the best practices to do such things without exposing myself to security issues
- I have two servers both use the same private key for login.
- Server 2 copies files to Server 1 via scp (currently I save the private key on Server 2)
If any hacker ever gets control of server 2 he will also get the private key and hence both the servers will get compromised.
I am pretty sure that this is a very common scenario for most of the configurations and want to know what are the best practices in such cases.