Skip to content

Instantly share code, notes, and snippets.

@valmayaki
Last active April 12, 2020 23:50
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 valmayaki/96c8ddd537a43c3ffea312c554e1b315 to your computer and use it in GitHub Desktop.
Save valmayaki/96c8ddd537a43c3ffea312c554e1b315 to your computer and use it in GitHub Desktop.
SSH Tips

Port forward to MySQL database

ssh -M -S <my-socket-name> -fNT -L localhost:33067:localhost:3306 <user>@<hostname>
  • -f Run in the background before command execution.
  • -N Don’t execute any commands
  • -T Disable pseudo-tty allocation. I don’t know what this means.
  • -S socketname Use a control socket with name socketname
  • -M Put control socket in master mode
  • -O check, exit, stop Control command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment