Skip to content

army-cat/trooper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cb48e59 · Aug 10, 2022

History

31 Commits
Oct 26, 2019
Mar 19, 2021
Aug 10, 2022
Mar 19, 2021
Mar 5, 2019
Mar 19, 2021
Mar 12, 2016
Mar 5, 2019
Mar 19, 2021
Sep 27, 2017
Oct 16, 2019
Sep 27, 2017
Oct 16, 2019

Repository files navigation

Trooper

Copyright (c) 2016-2021 Altenwald Solutions, S.L.

Authors: "Manuel Rubio (manuel@altenwald.com).

Build Status Codecov License: LGPL 2.1 Hex

Trooper is a soldier in charge to go to other machines (via SSH) and follow your commands.

Trooper requires to be run over an Erlang/OTP 19+.

⚠️ Don't use DSA for OTP 23+, we found very difficult to put this working. But if you achieve it, please let us know how!

Erlang Version Support Notes
23.2 ✔️ Recommended if you use OTP 23
23.1 ✔️
23.0 ✔️
22.3 ✔️ Recommended if you use OTP 22
22.2 ✔️
22.1 ✔️
22.0 ✔️
21.3 ✔️ Recommended if you use OTP 21
21.2 ✔️
21.1 ✔️
21.0 ✔️
20.3 ✔️ Recommended if you use OTP 20
20.2 ✔️
20.1 ✔️
20.0 ✔️
19.3 ✔️ Recommended if you use OTP 19
19.2 ✔️
19.1 ✔️
19.0 ✔️
1> {ok, File} = file:read_file("/home/trooper/.ssh/id_rsa").
{ok,<<"-----BEGIN RSA PRIVATE KEY-----\nMIIE"...>>}
2> {ok,Trooper} = trooper_ssh:start([{host, "trooper.com"},
                                     {user, "trooper"},
                                     {id_rsa, File}]), ok.
ok
3> trooper_ssh:exec(Trooper, "ls -lha").
{ok,0,
    <<"total 128K\ndrwxr-xr-x 10 trooper trooper 4.0K Mar  8 16:54"...>>}
4> trooper_ssh:exec(Trooper, "ls not_found").
{ok,2,
    <<"ls: cannot access not_found: No such file or directory\n">>}
5> trooper_ssh:stop(Trooper).
ok

You can use for the options whatever from ssh:connect/3 options.

Enjoy!

Modules

trooper_app
trooper_keys
trooper_proxy
trooper_proxy_chain
trooper_proxy_sup
trooper_scp
trooper_ssh