I have an AWS cloud server that runs linux, to which i connect from my home computer. So far I used to use Putty to connect to it (Windows) but I just switched to Linux for my home computer.
I am trying to figure out how to create a tunnel while using a private key to connect through ssh.
The example on the different doc website is pretty straightforward:
To connect to the remote server:
ssh -i <key_file> [email protected]
This does work.
However to create a tunnel the doc mentions
ssh -L8080(portnumber):[email protected]:8080(remoteport)
But there isn't any mention of how to create a tunnel using a private key as in the first example.
I tried ssh -i <key_file> -L8080(portnumber):[email protected]:8080(remoteport)
but it didn't work.
Can anyone provide the correct command to create the tunnel while using a private key? Thanks!