| Safe Haskell | None |
|---|
Network.SSH.Client.LibSSH2
- data Session
- data Channel
- data KnownHosts
- withSSH2 :: FilePath -> FilePath -> FilePath -> String -> String -> String -> Int -> (Session -> IO a) -> IO a
- withSession :: String -> Int -> (Session -> IO a) -> IO a
- withChannel :: Session -> (Channel -> IO a) -> IO (Int, a)
- withChannelBy :: IO a -> (a -> Channel) -> (a -> IO b) -> IO (Int, b)
- checkHost :: Session -> String -> Int -> FilePath -> IO KnownHostResult
- readAllChannel :: Channel -> IO ByteString
- writeAllChannel :: Channel -> ByteString -> IO ()
- scpSendFile :: Session -> Int -> FilePath -> FilePath -> IO Integer
- scpReceiveFile :: Session -> FilePath -> FilePath -> IO Integer
- runShellCommands :: Session -> [String] -> IO (Int, [ByteString])
- execCommands :: Session -> [String] -> IO (Int, [ByteString])
- socketConnect :: String -> Int -> IO Socket
Types
data KnownHosts Source
Functions
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.
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
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
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
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.
Receive file from remote host via SCP. Returns size of received data.
runShellCommands :: Session -> [String] -> IO (Int, [ByteString])Source
execCommands :: Session -> [String] -> IO (Int, [ByteString])Source