From 6303b288edbaa79c6b55f02403cf6d0f40dde839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandru=20Bogdan=20B=C3=A2gu?= Date: Fri, 24 Feb 2017 09:48:16 +0200 Subject: [PATCH 1/2] update documentation: show how to use password --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fcccf48..677fe86 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,22 @@ Library to unify helpers already used on several applications. It uses low level The only purpose of these helpers is to avoid repetitive patterns seen when working with SSH from Elixir. It doesn't mean to hide anything from the venerable code underneath. If there's an ugly crash from `:ssh` it will come back as `{:error, reason}`. -## Use +## Instalation + +Just add `{:sshex, "2.1.1"}` to your deps on `mix.exs` and run `mix deps.get` -Just add `{:sshex, "2.1.1"}` to your deps on `mix.exs`. +## Use Then assuming `:ssh` application is already started with `:ssh.start` (hence it is listed on deps), you should acquire an SSH connection using `SSHEx.connect/1` like this: +1.You can use `ssh-copy-id myuser@123.123.123.123.123` to copy ssh key to remote host and then connect using this line: ```elixir {:ok, conn} = SSHEx.connect ip: '123.123.123.123', user: 'myuser' ``` +2.You can supply the password: +```elixir +{:ok, conn} = SSHEx.connect ip: '123.123.123.123', user: 'myuser', password: 'your-password' +``` Then you can use the acquired `conn` with the `cmd!/4` helper like this: From 7290420cbd91be41f0d00a0ce7db4844e1c6bd63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Caro?= Date: Sun, 19 Mar 2017 09:09:47 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 677fe86..34a9da8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Library to unify helpers already used on several applications. It uses low level The only purpose of these helpers is to avoid repetitive patterns seen when working with SSH from Elixir. It doesn't mean to hide anything from the venerable code underneath. If there's an ugly crash from `:ssh` it will come back as `{:error, reason}`. -## Instalation +## Installation Just add `{:sshex, "2.1.1"}` to your deps on `mix.exs` and run `mix deps.get`