libssh2-0.2.0.1: FFI bindings to libssh2 SSH2 client library (http://libssh2.org/)

Safe HaskellNone

Network.SSH.Client.LibSSH2

Contents

Synopsis

Types

Functions

withSSH2Source

Arguments

:: FilePath

Path to known_hosts file

-> FilePath

Path to public key file

-> FilePath

Path to private key file

-> String

Passphrase

-> String

Remote user name

-> String

Remote host name

-> Int

Remote port number (usually 22)

-> (Session -> IO a)

Actions to perform on session

-> IO a 

Execute some actions within SSH2 connection. Uses public key authentication.

withSessionSource

Arguments

:: String

Remote host name

-> Int

Remote port number (usually 22)

-> (Session -> IO a)

Actions to perform on handle and session

-> IO a 

Execute some actions within SSH2 session

withChannel :: Session -> (Channel -> IO a) -> IO (Int, a)Source

Execute some actions withing SSH2 channel

withChannelBySource

Arguments

:: IO a

Create a channel (and possibly other stuff)

-> (a -> Channel)

Extract the channel from other stuff

-> (a -> IO b)

Actions to execute on the channel

-> IO (Int, b)

Channel exit status and return value

Generalization of withChannel

checkHostSource

Arguments

:: Session 
-> String

Remote host name

-> Int

Remote port number (usually 22)

-> FilePath

Path to known_hosts file

-> IO KnownHostResult 

readAllChannel :: Channel -> IO ByteStringSource

Read all data from the channel

Although this function returns a lazy bytestring, the data is not read lazily.

writeAllChannel :: Channel -> ByteString -> IO ()Source

Write a lazy bytestring to the channel

scpSendFileSource

Arguments

:: Session 
-> Int

File creation mode (0o777, for example)

-> FilePath

Path to local file

-> FilePath

Remote file path

-> IO Integer 

Send a file to remote host via SCP. Returns size of sent data.

scpReceiveFileSource

Arguments

:: Session 
-> FilePath

Remote file path

-> FilePath

Path to local file

-> IO Integer 

Receive file from remote host via SCP. Returns size of received data.

Utilities

socketConnect :: String -> Int -> IO SocketSource

Similar to Network.connectTo, but does not socketToHandle.