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> firstname.lastname@example.org
This does work.
However to create a tunnel the doc mentions
But there isn't any mention of how to create a tunnel using a private key as in the first example.
ssh -i <key_file> -L8080(portnumber):email@example.com:8080(remoteport)
but it didn't work.
Can anyone provide the correct command to create the tunnel while using a private key? Thanks!