I have 2 machines ('a' and 'b'), and I want to connect to a server as user 'x' which only has the ssh key (public) of machine 'a'.
Now, if I'm 'user_a' in host 'a', in order to connect to the server I
If I'm user 'user_b' in host 'b', I have to
$ ssh user_a@a
$ ssh x@server
Note that this works. No hangs, no fails. So I wanted to make a tunnel.
I tried tunneling before, and it worked, but this doesn't work as I expected
$ ssh -f -N -L port:server:22 user_a@a #create tunnel
$ ssh x@localhost:50000 #hangs so ctrl^c
$ ssh localhost:50000 #also hangs
I cannot mess with the server at all, and I don't want to create a user at machines 'a' and 'b' just to login to server.
Google wasn't a good teacher at this one. Everything I found was for the same user.
What can I do to accomplish my task (if anything)?
I just want to avoid typing 2 calls to ssh, no tunnel is actually necessary. But obviously I don't want to automatically ssh to 'server' everytime I ssh to 'a'.