Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

update documentation: show how to use password #14

Merged
merged 2 commits into from
Mar 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
## Installation

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 [email protected]` 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:

Expand Down