Safe Haskell | None |
---|
- data KnownHosts
- data KnownHostResult
- data KnownHostType
- = TYPE_MASK
- | TYPE_PLAIN
- | TYPE_SHA1
- | TYPE_CUSTOM
- | KEYENC_MASK
- | KEYENC_RAW
- | KEYENC_BASE64
- | KEY_MASK
- | KEY_SHIFT
- | KEY_RSA1
- | KEY_SSHRSA
- | KEY_SSHDSS
- data KnownHost = KnownHost {
- khMagic :: CUInt
- khNode :: Ptr ()
- khName :: String
- khKey :: String
- khTypeMask :: [KnownHostType]
- initialize :: Bool -> IO ()
- exit :: IO ()
- initSession :: IO Session
- freeSession :: Session -> IO ()
- disconnectSession :: Session -> String -> IO ()
- handshake :: Session -> Socket -> IO ()
- setBlocking :: Session -> Bool -> IO ()
- initKnownHosts :: Session -> IO KnownHosts
- freeKnownHosts :: KnownHosts -> IO ()
- knownHostsReadFile :: KnownHosts -> FilePath -> IO Int
- getHostKey :: Session -> IO (String, Size, CInt)
- checkKnownHost :: KnownHosts -> String -> Int -> String -> [KnownHostType] -> IO KnownHostResult
- publicKeyAuthFile :: Session -> String -> String -> String -> String -> IO ()
- usernamePasswordAuth :: Session -> String -> String -> IO ()
- openChannelSession :: Session -> IO Channel
- closeChannel :: Channel -> IO ()
- freeChannel :: Channel -> IO ()
- channelSendEOF :: Channel -> IO ()
- channelWaitEOF :: Channel -> IO ()
- channelIsEOF :: Channel -> IO Bool
- readChannel :: Channel -> Size -> IO ByteString
- writeChannel :: Channel -> ByteString -> IO ()
- writeChannelFromHandle :: Channel -> Handle -> IO Integer
- readChannelToHandle :: Channel -> Handle -> Offset -> IO Integer
- channelProcess :: Channel -> String -> String -> IO ()
- channelExecute :: Channel -> String -> IO ()
- channelShell :: Channel -> IO ()
- requestPTY :: Channel -> String -> IO ()
- requestPTYEx :: Channel -> String -> String -> Int -> Int -> Int -> Int -> IO Int
- channelExitStatus :: Channel -> IO Int
- channelExitSignal :: Channel -> IO (Int, String, Maybe String, Maybe String)
- scpSendChannel :: Session -> String -> Int -> Int64 -> POSIXTime -> POSIXTime -> IO Channel
- scpReceiveChannel :: Session -> FilePath -> IO (Channel, Offset)
- data TraceFlag
- setTraceMode :: Session -> [TraceFlag] -> IO ()
Types
data KnownHosts Source
data KnownHostResult Source
data KnownHostType Source
Session functions
initialize :: Bool -> IO ()Source
Initialize libssh2. Pass True to enable encryption or False to disable it.
initSession :: IO SessionSource
Create Session object
freeSession :: Session -> IO ()Source
Free Session object's memory
Disconnect session (but do not free memory)
setBlocking :: Session -> Bool -> IO ()Source
Known hosts functions
initKnownHosts :: Session -> IO KnownHostsSource
Create KnownHosts object for given session.
freeKnownHosts :: KnownHosts -> IO ()Source
Free KnownHosts object's memory
:: KnownHosts | |
-> FilePath | Path to known_hosts file |
-> IO Int |
Read known hosts from file
:: KnownHosts | |
-> String | Host name |
-> Int | Port number (usually 22) |
-> String | Host public key |
-> [KnownHostType] | Host flags (see libssh2 documentation) |
-> IO KnownHostResult |
Check host data against known hosts.
Authentication
:: Session | Session |
-> String | Username |
-> String | Path to public key |
-> String | Path to private key |
-> String | Passphrase |
-> IO () |
Perform public key authentication.
Perform username/password authentication.
Channel functions
openChannelSession :: Session -> IO ChannelSource
Open a channel for session.
closeChannel :: Channel -> IO ()Source
Close channel (but do not free memory)
freeChannel :: Channel -> IO ()Source
Free channel object's memory
channelSendEOF :: Channel -> IO ()Source
channelWaitEOF :: Channel -> IO ()Source
channelIsEOF :: Channel -> IO BoolSource
writeChannel :: Channel -> ByteString -> IO ()Source
Write data to channel.
writeChannelFromHandle :: Channel -> Handle -> IO IntegerSource
Write all data to channel from handle. Returns amount of transferred data.
readChannelToHandle :: Channel -> Handle -> Offset -> IO IntegerSource
Read all data from channel to handle. Returns amount of transferred data.
channelExecute :: Channel -> String -> IO ()Source
Execute command
channelShell :: Channel -> IO ()Source
Execute shell command
requestPTY :: Channel -> String -> IO ()Source
channelExitStatus :: Channel -> IO IntSource
Get channel exit status
channelExitSignal :: Channel -> IO (Int, String, Maybe String, Maybe String)Source
Get channel exit signal. Returns: (possibly error code, exit signal name, possibly error message, possibly language code).
scpSendChannel :: Session -> String -> Int -> Int64 -> POSIXTime -> POSIXTime -> IO ChannelSource
Create SCP file send channel.
scpReceiveChannel :: Session -> FilePath -> IO (Channel, Offset)Source
Create SCP file receive channel. TODO: receive struct stat also.
Debug
setTraceMode :: Session -> [TraceFlag] -> IO ()Source