Skip to content

Instantly share code, notes, and snippets.

@nickoala
Last active March 11, 2016 15:42
Show Gist options
  • Save nickoala/2b5c893369aed301878a to your computer and use it in GitHub Desktop.
Save nickoala/2b5c893369aed301878a to your computer and use it in GitHub Desktop.
How to remote port forward on Raspbian

Configure SSH server to allow port forward

Edit /etc/ssh/sshd_config:

AllowTcpForwarding yes
GatewayPorts yes

Restart or reboot.

Execute this command on client

ssh -o StrictHostKeyChecking=no -N -R <remoteport>:localhost:<localport> -p<sshport> <[email protected]>

In a shell script, use sshpass to supply password and append an & to run in background.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment