Search code examples
linuxsshssh-tunnel

SSH Tunnel Issue


I'm trying to tunnel to a remote VM.

I previously used the below command:

ssh -N -p 22 username@1.2.3.4 -o StrictHostKeyChecking=no -L 127.0.0.1:8080:5.6.7.8:443

Something went wrong with the server at the weekend and the SA had to restore the image.

Now when I try to do this I get prompted with the following:

Permission denied, please try again.
username@1.2.3.4's password: 

I don't know what this password should be and the SA isn't available. I am able to ssh directly onto 1.2.3.4 using my public key and when on it I can ssh onto 5.6.7.8 with this command:

ssh -A blueboxadmin@5.6.7.8

Is there any way I can use this to tunnel right through. Failing that, is there anything I can setup on 1.2.3.4 that will allow me to tunnel through?


Solution

  • Looks like the ssh key value pair is missing from the remote server.

    You will have to copy the entry of you server ssh key (from $HOME/.ssh/id_rsa.pub file) into the remote server's $HOME/.ssh/authorized_keys file. Make sure the key is pasted in a single line. After doing this, you should be able to connect.