Thank you for the information. Some clarifications.
user-MacBook-Pro:~ user$ ssh -i /Users/user/Desktop/wednesday.pem -L 8888:127.0.0.1:80 email@example.com
The authenticity of host '188.8.131.52 (184.108.40.206)' can't be established.
ECDSA key fingerprint is SHA256:pZgTIgU0gBgI59XvvQhTt4P1sf1UkB6a0HaZ0XQfh24.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '220.127.116.11' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-1095-aws x86_64)
___ _ _ _
| _ |_) |_ _ _ __ _ _ __ (_)
| _ \ | _| ' \/ _` | ' \| |
*** Welcome to the Bitnami LAMP 7.1.28-0 ***
*** Documentation: https://docs.bitnami.com/aws/infrastructure/lamp/ ***
*** https://docs.bitnami.com/aws/ ***
*** Bitnami Forums: https://community.bitnami.com/ ***
Last login: Wed Oct 16 06:03:45 2019 from 18.104.22.168
As you noticed, you need to use the
/Users/user/Desktop/wednesday.pem key to access your server. That means that you always need to use that one when executing the ssh command against that server.
This command opens the SSH connection so you can access the terminal but it also creates the tunnel to the 80 port (that means that you can access phpMyAdmin while the connection is open). To exit the ssh connection and close the tunnel just use "logout" as you did or "exit".
The difference here is that you used the "-N" option (that options makes the ssh command not to run any command in the remote machine so it's useful to only create SSH tunnels). However you forgot to set the ssh key, you set the -i parameter but didn't set the key to use "/Users/user/Desktop/wednesday.pem".
To sum up:
- This command creates the tunnel and open the terminal
ssh -i /Users/user/Desktop/wednesday.pem -L 8888:127.0.0.1:80 firstname.lastname@example.org
- This other one creates the ssh tunnel but won't open the terminal. When you execute it, it looks like it got frozen but that's not true. Try accessing http://localhost:8888/phpmyadmin and you'll see that the ssh tunnel works properly
ssh -i /Users/user/Desktop/wednesday.pem -N -L 8888:127.0.0.1:80 email@example.com
Happy to help!
Was my answer helpful? Click on