Skip to content

Instantly share code, notes, and snippets.

@nickoala
Last active March 11, 2016 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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> <user@server.host.com>

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