ostap
`:ssh.daemon` - can't get port tunneling to work (via tcpip_tunnel_in: true)
Hello. I’ve noticed the tcpip_tunnel_in option in the Erlang documentation for the ssh module and trying to make it work.
defmodule MyApp.SSHDaemon do
@sys_dir String.to_charlist("#{Path.expand(".")}/sys_dir")
def start_link do
:ssh.daemon(
4445,
system_dir: @sys_dir,
no_auth_needed: true,
# disconnectfun: &log_it/1,
# connectfun: &log_it/3,
# failfun: &log_it/3,
tcpip_tunnel_in: true
)
end
def child_spec(_) do
%{
id: __MODULE__,
start: {__MODULE__, :start_link, []},
name: __MODULE__
}
end
def log_it(a1, a2 \\ nil, a3 \\ nil, a4 \\ nil, a5 \\ nil, a6 \\ nil) do
require Logger
Logger.debug(
"#{inspect(a1)}, #{inspect(a2)}, #{inspect(a3)}, #{inspect(a4)}, #{inspect(a5)}, #{inspect(a6)}"
)
end
end
Here’s how I’ve generated the sample keys:
mkdir sys_dir
ssh-keygen -N '' -b 256 -t ecdsa -f sys_dir/ssh_host_ecdsa_key
Connecting to it this way:
❯❯❯ ssh -R 8082:localhost:8080 127.0.0.1 -p 4445
Warning: remote port forwarding failed for listen port 8082
Eshell V14.1.1 (press Ctrl+G to abort, type help(). for help)
1>
Any advice or examples on getting TCP port forwarding to work here?
Marked As Solved
ostap
Turns out I misunderstood the options and the correct one is tcpip_tunnel_out, not tcpip_tunnel_in. (notice -R in my ssh command usage)
1
Popular in Questions
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
lets say i have a sample like
a = 20; b = 10;
if (a > b) do
{:ok, "a"}
end
if (a < b) do
{:ok, b}
end
if (a == b) do
{:ok, "equa...
New
can someone please explain to me how Enum.reduce works with maps
New
Hello, how can I check the Phoenix version ?
Thanks !
New
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
I tried installing
elixir 1.11.2
erlang 23.3.4
via asdf in my zsh shell. Enabled the versions locally and globally.
When I list them ...
New
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Okay, I’m having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I’m sure I’...
New
Hi!
Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
Other popular topics
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode.
The solution seems to be, in a hyphena...
New
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help.
Where are they similar?
Where do they differ the m...
New
I tried installing
elixir 1.11.2
erlang 23.3.4
via asdf in my zsh shell. Enabled the versions locally and globally.
When I list them ...
New
Hi everyone,
I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including.
What is Phoenix LiveV...
New
I would like to know what is the best IDE for elixir development?
New
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









