Skip to content

Instantly share code, notes, and snippets.

View ckoch-cars's full-sized avatar
💭
😸

Christian Koch ckoch-cars

💭
😸
View GitHub Profile
@ckoch-cars
ckoch-cars / gist:15a88fcb0bc2f4abbed09b49879edf31
Last active February 9, 2025 02:06
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