Erlang ssh key client set

I use the :client API to connect to an external node and use the code there remotely, but still I use Dokku for deployment, and it would be really nice if I could specify the ssh key at runtime.

My code now looks something like this:

 def start(host) do allow_boot to_char_list(host) {:ok, slave} = :slave.start(to_char_list(host), :slave, inet_loader_args) load_paths(slave) {:ok, slave} end 

inet_loader_args == ' -rsh ssh -loader inet -hosts #{master_node_ip} -setcookie #{:erlang.get_cookie}'

I tried something like setting the -rsh argument as "-rsh ssh -i /path/to/id_rsh" , but it seems to completely ignore it, I'm not quite sure how this is implemented, and Erlang docs for :client little difficult understand for me (I see that he uses :ssh somewhere and can take the argument "user_dir", which may contain the key file, but I'm not sure how to install it from :client )

Any ideas?

+5
source share

Source: https://habr.com/ru/post/1237064/


All Articles