Skip to content

Instantly share code, notes, and snippets.

View ck-work00's full-sized avatar
💭
😸

Christian Koch ck-work00

💭
😸
View GitHub Profile
@ck-work00
ck-work00 / gist:15a88fcb0bc2f4abbed09b49879edf31
Last active October 21, 2025 07:39
Erlang ssh connect with SSH key
# Specifically we are trying to do 2 things with the erlang `:ssh` module:
# Make a connection (use :ssh.connect/4`) and pass in the ssh key from something other than a file on disk
# And then with an open connection, bind the connection to a local port (i.e. setup a ssh tunnel)
# use :ssh.tcpip_tunnel_to_server/5 or :ssh.tcpip_tunnel_to_server/6
# Example (working) code:
defmodule SSHTunnel do
@local_port 9999
@remote_port 1234