These is my scenario:
- Host C is not accessible from A.
- Host B is accessible from A.
- Host C is accessible from B.
- Both B and C have
~/.ssh/id_rsa.pub(from A) inauthorized_keys - B does not have the private key (
~/.ssh/id_rsa), since it would be a security risk (the key is personal). - since B doed not have the private key, it is not possible to login to C from it
How can I use the key in host A to login to host C? Is this possible? I fear not.
(similar but different to this question)
EDIT
What I would need is a way to provide, on-the-fly (stdin or similar), the private key to the ssh hop in B, without it ever touching the filesystem in B. Is this possible?
man sshto know more about ssh tunnels. Tunnel only tries to connect to host C, when he start using the tunnel. He can forward also port 80 or any other. It's only a portforward, not an authenticated connection. – Ipor Sircer Oct 09 '18 at 11:14