Akd v0.2.1 Akd.SecureConnection View Source

This module defines helper functions that are used by Akd to execute a set of commands through the Secure channel, examples: ssh and scp

Link to this section Summary

Functions

Takes a source and a destination and copies src to destination

Takes a destination and commands and runs those commands on that destination

Takes a user, host and a string of operations and runs those operations on that host

Link to this section Functions

Link to this function scp(src, dest, opts \\ []) View Source

Takes a source and a destination and copies src to destination

Examples

iex> src = "user@host:~/path"
iex> dest = "user2@host2:~/path2"
iex> Akd.SecureConnection.scp(src, dest)
{:error, %IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}}

iex> src = "user@host:~/path"
iex> dest = "user2@host2:~/path2"
iex> Akd.SecureConnection.scp(src, dest, ["-p a"])
{:error, %IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}}

Takes a destination and commands and runs those commands on that destination.

Examples

iex> Akd.SecureConnection.securecmd(Akd.Destination.local(), "echo hi")
{:error, %IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}}
Link to this function ssh(user, scoped_ip, operations, stdio \\ false) View Source

Takes a user, host and a string of operations and runs those operations on that host

Examples

iex> Akd.SecureConnection.ssh(:current, :local, "echo hi")
{:error, ""}

iex> Akd.SecureConnection.ssh(:current, :local, "echo hi", true)
{:error, %IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}}