diff --git a/lib/client.dart b/lib/client.dart index 542cae7..8dd4cad 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -585,6 +585,13 @@ class SSHClient extends SSHTransport with SSHAgentForwarding { '', false)); } + + void exec(String command, {bool wantReply = true}) { + assert(socket != null && sessionChannel != null); + if (socket == null || sessionChannel == null) return; + writeCipher(MSG_CHANNEL_REQUEST.exec( + sessionChannel.remoteId, 'exec', command, wantReply)); + } } /// Implement same [SocketInterface] as actual [Socket] but over [SSHClient] tunnel.