Supporting libssh2 sessions and channels. Supports both iOS and Android.
npm install capacitor-ssh-plugin
npx cap sync
StartByPasswd
|
**Returns:** Promise<string>
--------------------
### startSessionByKey(...)
```typescript
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(...)
```typescript
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(...)
```typescript
startShell(options: { channel: SSHChannelID; command?: string; }, callback: STDOutCallback) => Promise{ channel: number; command?: string; }
|
| **`callback`** | STDOutCallback
|
**Returns:** Promise<string>
--------------------
### writeToChannel(...)
```typescript
writeToChannel(options: { channel: number; s: string; }) => Promise{ channel: number; s: string; }
|
--------------------
### closeChannel(...)
```typescript
closeChannel(options: { channel: number; }) => Promise{ channel: number; }
|
--------------------
### setPtySize(...)
```typescript
setPtySize(options: { channel: number; width: number; height: number; }) => Promise{ channel: number; width: number; height: number; }
|
--------------------
### Interfaces
#### StartByPasswd
parameters used when opening a session by password
| Prop | Type |
| -------------- | ------------------- |
| **`address`** | string
|
| **`port`** | number
|
| **`username`** | string
|
| **`password`** | string
|
#### StartByKey
parameters used when opening a session by indetity key
| Prop | Type |
| -------------- | ------------------- |
| **`address`** | string
|
| **`port`** | number
|
| **`username`** | string
|
| **`tag`** | string
|
### Type Aliases
#### SSHSessionID
Session ID
string
#### SSHChannelID
Channel ID
number
#### STDOutCallback
(message: string | null, err?: any): void
### Enums
#### TerminalType
| Members | Value |
| ------------------------ | -------------- |
| **`PtyNone`** | 0
|
| **`PtyTerminalVanilla`** | |
| **`PtyTerminalVT100`** | |
| **`PtyTerminalVT102`** | |
| **`PtyTerminalVT220`** | |
| **`PtyTerminalAnsi`** | |
| **`PtyTerminalXterm`** | |