SSH Local port forwarding $ ssh -L 0.0.0.0:local_port:target:target_port username@bastion SSH Reverse port forwarding $ ssh -R local_ip:local_port:target_ip:target_port username@local_ip SSH Dynamic Port Forwarding $ ssh -D 127.0.0.1:local_port username@bastion Useful options and tips in SSH port forwarding sessions -f: This option requests SSH to go into the background just before it executes the command. This is commonly used when you want to set up port forwarding without opening an interactive shell session.
If you try to connect to a remote host using ssh and get a message like this: ❯ ssh ruben@<external_host> You have two possible methods to fix it: Option 1 The warning message shows us that the issue is located in line 39 of the kown_hosts file. Deleting that file should fix the warning. Option 2 ❯ ssh-keygen -R <external_host>
This week I needed to verify an SSH private key password as I wasn’t sure if it was the correct password. After some Google research, I found this blog post with the exact solution to my question: How to verify your SSH private key password ssh-keygen -y -f /path/to/ssh_key -y: parameter will help us to verify the password key, checking the private key and printing the public key to the stdout.