OpenSSH

SSH Tunneling

ssh -2 -N -f -L 6669:irc.linpro.no:6667 user@pichove.org

... will create a tunnel from localhost:6669 to irc.linpro.no:6667 through pichove.org



ssh -2 -N -R 6669:irc.linpro.no:6667 user@pichove.org

... will create a tunnel from localhost:6669 on pichove.org to irc.linpro.no:6667 through the machine currently running the process



ssh -2 -N -n -T -D 9999 user@pichove.org

... will create a tunnel from localhost:9999 to pichove.org (SOCKS)



Argument description

  • -2 Forces ssh to use version 2 of the protocol
  • -D Specifies a local “dynamic” application-level port forwarding. ssh will act as a SOCKS server.
  • -f Forces ssh to run in the background
  • -L Indicates a local tunnel in localport:remotehost:remoteport fashion
  • -N Indicates no command, or tunnel only. If omitted, ssh would initiate a normal session
  • -n Redirects stdin from /dev/null
  • -R Indicates a remote tunnel in localport:remotehost:remoteport fashion
  • -T Disables pseudo-tty allocation



Key manipulation

ssh-keygen -f <priv-key-file> -p

... changes the private key password



ssh-keygen -l -E md5 -f <pub-key-file>

... displays MD5 fingerprint of the public key

2026-04-07 11:39:57

minicms - © 2020-2026 Simeon Simeonov