Supporting libssh2 sessions and channels. Supports both iOS and Android.
npm install capacitor-ssh-plugin
npx cap sync- startSessionByPasswd(...)
- startSessionByKey(...)
- newChannel(...)
- startShell(...)
- writeToChannel(...)
- closeChannel(...)
- setPtySize(...)
- Interfaces
- Type Aliases
- Enums
startSessionByPasswd(options: StartByPasswd) => Promise<SSHSessionID>connect to a host using a username & password
| Param | Type | 
|---|---|
| options | StartByPasswd | 
Returns: Promise<string>
startSessionByKey(options: StartByKey) => Promise<{ session: string; }>connect to a host using an identity key. The pa
| Param | Type | 
|---|---|
| options | StartByKey | 
Returns: Promise<{ session: string; }>
newChannel(options: { session: SSHSessionID; pty?: TerminalType; }) => Promise<{ id: number; }>given a connected session and an optional terminal type, start a new channel
| Param | Type | 
|---|---|
| options | { session: string; pty?: TerminalType; } | 
Returns: Promise<{ id: number; }>
startShell(options: { channel: SSHChannelID; command?: string; }, callback: STDOutCallback) => Promise<string>given a channel, start a login shell.
The function also recieves a callback which is called when messages arrive on the channel.
| Param | Type | 
|---|---|
| options | { channel: number; command?: string; } | 
| callback | STDOutCallback | 
Returns: Promise<string>
writeToChannel(options: { channel: number; s: string; }) => Promise<void>writes a message to an open channel
| Param | Type | 
|---|---|
| options | { channel: number; s: string; } | 
closeChannel(options: { channel: number; }) => Promise<void>| Param | Type | 
|---|---|
| options | { channel: number; } | 
setPtySize(options: { channel: number; width: number; height: number; }) => Promise<void>| Param | Type | 
|---|---|
| options | { channel: number; width: number; height: number; } | 
parameters used when opening a session by password
| Prop | Type | 
|---|---|
| address | string | 
| port | number | 
| username | string | 
| password | string | 
parameters used when opening a session by indetity key
| Prop | Type | 
|---|---|
| address | string | 
| port | number | 
| username | string | 
| tag | string | 
Session ID
string
Channel ID
number
(message: string | null, err?: any): void
| Members | Value | 
|---|---|
| PtyNone | 0 | 
| PtyTerminalVanilla | |
| PtyTerminalVT100 | |
| PtyTerminalVT102 | |
| PtyTerminalVT220 | |
| PtyTerminalAnsi | |
| PtyTerminalXterm |