Kaynağa Gözat

Add interface to SshClient (#1499)

Eugen Cowie 1 yıl önce
ebeveyn
işleme
82246e3cc9

+ 5 - 0
src/Renci.SshNet/IBaseClient.cs

@@ -51,6 +51,11 @@ namespace Renci.SshNet
         /// </summary>
         event EventHandler<HostKeyEventArgs> HostKeyReceived;
 
+        /// <summary>
+        /// Occurs when server identification received.
+        /// </summary>
+        event EventHandler<SshIdentificationEventArgs>? ServerIdentificationReceived;
+
         /// <summary>
         /// Connects client to the server.
         /// </summary>

+ 246 - 0
src/Renci.SshNet/ISshClient.cs

@@ -0,0 +1,246 @@
+#nullable enable
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+
+using Renci.SshNet.Common;
+
+namespace Renci.SshNet
+{
+    /// <summary>
+    /// Provides client connection to SSH server.
+    /// </summary>
+    public interface ISshClient : IBaseClient
+    {
+        /// <summary>
+        /// Gets the list of forwarded ports.
+        /// </summary>
+        IEnumerable<ForwardedPort> ForwardedPorts { get; }
+
+        /// <summary>
+        /// Adds the forwarded port.
+        /// </summary>
+        /// <param name="port">The port.</param>
+        /// <exception cref="InvalidOperationException">Forwarded port is already added to a different client.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="port"/> is <see langword="null"/>.</exception>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        public void AddForwardedPort(ForwardedPort port);
+
+        /// <summary>
+        /// Stops and removes the forwarded port from the list.
+        /// </summary>
+        /// <param name="port">Forwarded port.</param>
+        /// <exception cref="ArgumentNullException"><paramref name="port"/> is <see langword="null"/>.</exception>
+        public void RemoveForwardedPort(ForwardedPort port);
+
+        /// <summary>
+        /// Creates the command to be executed.
+        /// </summary>
+        /// <param name="commandText">The command text.</param>
+        /// <returns><see cref="SshCommand"/> object.</returns>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        public SshCommand CreateCommand(string commandText);
+
+        /// <summary>
+        /// Creates the command to be executed with specified encoding.
+        /// </summary>
+        /// <param name="commandText">The command text.</param>
+        /// <param name="encoding">The encoding to use for results.</param>
+        /// <returns><see cref="SshCommand"/> object which uses specified encoding.</returns>
+        /// <remarks>This method will change current default encoding.</remarks>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="commandText"/> or <paramref name="encoding"/> is <see langword="null"/>.</exception>
+        public SshCommand CreateCommand(string commandText, Encoding encoding);
+
+        /// <summary>
+        /// Creates and executes the command.
+        /// </summary>
+        /// <param name="commandText">The command text.</param>
+        /// <returns>Returns an instance of <see cref="SshCommand"/> with execution results.</returns>
+        /// <remarks>This method internally uses asynchronous calls.</remarks>
+        /// <exception cref="ArgumentException">CommandText property is empty.</exception>
+        /// <exception cref="SshException">Invalid Operation - An existing channel was used to execute this command.</exception>
+        /// <exception cref="InvalidOperationException">Asynchronous operation is already in progress.</exception>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="commandText"/> is <see langword="null"/>.</exception>
+        public SshCommand RunCommand(string commandText);
+
+        /// <summary>
+        /// Creates the shell.
+        /// </summary>
+        /// <param name="input">The input.</param>
+        /// <param name="output">The output.</param>
+        /// <param name="extendedOutput">The extended output.</param>
+        /// <param name="terminalName">Name of the terminal.</param>
+        /// <param name="columns">The columns.</param>
+        /// <param name="rows">The rows.</param>
+        /// <param name="width">The width.</param>
+        /// <param name="height">The height.</param>
+        /// <param name="terminalModes">The terminal mode.</param>
+        /// <param name="bufferSize">Size of the internal read buffer.</param>
+        /// <returns>
+        /// Returns a representation of a <see cref="Shell" /> object.
+        /// </returns>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        public Shell CreateShell(Stream input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint>? terminalModes, int bufferSize);
+
+        /// <summary>
+        /// Creates the shell.
+        /// </summary>
+        /// <param name="input">The input.</param>
+        /// <param name="output">The output.</param>
+        /// <param name="extendedOutput">The extended output.</param>
+        /// <param name="terminalName">Name of the terminal.</param>
+        /// <param name="columns">The columns.</param>
+        /// <param name="rows">The rows.</param>
+        /// <param name="width">The width.</param>
+        /// <param name="height">The height.</param>
+        /// <param name="terminalModes">The terminal mode.</param>
+        /// <returns>
+        /// Returns a representation of a <see cref="Shell" /> object.
+        /// </returns>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        public Shell CreateShell(Stream input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint> terminalModes);
+
+        /// <summary>
+        /// Creates the shell.
+        /// </summary>
+        /// <param name="input">The input.</param>
+        /// <param name="output">The output.</param>
+        /// <param name="extendedOutput">The extended output.</param>
+        /// <returns>
+        /// Returns a representation of a <see cref="Shell" /> object.
+        /// </returns>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        public Shell CreateShell(Stream input, Stream output, Stream extendedOutput);
+
+        /// <summary>
+        /// Creates the shell.
+        /// </summary>
+        /// <param name="encoding">The encoding to use to send the input.</param>
+        /// <param name="input">The input.</param>
+        /// <param name="output">The output.</param>
+        /// <param name="extendedOutput">The extended output.</param>
+        /// <param name="terminalName">Name of the terminal.</param>
+        /// <param name="columns">The columns.</param>
+        /// <param name="rows">The rows.</param>
+        /// <param name="width">The width.</param>
+        /// <param name="height">The height.</param>
+        /// <param name="terminalModes">The terminal mode.</param>
+        /// <param name="bufferSize">Size of the internal read buffer.</param>
+        /// <returns>
+        /// Returns a representation of a <see cref="Shell" /> object.
+        /// </returns>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        public Shell CreateShell(Encoding encoding, string input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint>? terminalModes, int bufferSize);
+
+        /// <summary>
+        /// Creates the shell.
+        /// </summary>
+        /// <param name="encoding">The encoding.</param>
+        /// <param name="input">The input.</param>
+        /// <param name="output">The output.</param>
+        /// <param name="extendedOutput">The extended output.</param>
+        /// <param name="terminalName">Name of the terminal.</param>
+        /// <param name="columns">The columns.</param>
+        /// <param name="rows">The rows.</param>
+        /// <param name="width">The width.</param>
+        /// <param name="height">The height.</param>
+        /// <param name="terminalModes">The terminal modes.</param>
+        /// <returns>
+        /// Returns a representation of a <see cref="Shell" /> object.
+        /// </returns>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        public Shell CreateShell(Encoding encoding, string input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint> terminalModes);
+
+        /// <summary>
+        /// Creates the shell.
+        /// </summary>
+        /// <param name="encoding">The encoding.</param>
+        /// <param name="input">The input.</param>
+        /// <param name="output">The output.</param>
+        /// <param name="extendedOutput">The extended output.</param>
+        /// <returns>
+        /// Returns a representation of a <see cref="Shell" /> object.
+        /// </returns>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        public Shell CreateShell(Encoding encoding, string input, Stream output, Stream extendedOutput);
+
+        /// <summary>
+        /// Creates the shell without allocating a pseudo terminal,
+        /// similar to the <c>ssh -T</c> option.
+        /// </summary>
+        /// <param name="input">The input.</param>
+        /// <param name="output">The output.</param>
+        /// <param name="extendedOutput">The extended output.</param>
+        /// <param name="bufferSize">Size of the internal read buffer.</param>
+        /// <returns>
+        /// Returns a representation of a <see cref="Shell" /> object.
+        /// </returns>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        public Shell CreateShellNoTerminal(Stream input, Stream output, Stream extendedOutput, int bufferSize = -1);
+
+        /// <summary>
+        /// Creates the shell stream.
+        /// </summary>
+        /// <param name="terminalName">The <c>TERM</c> environment variable.</param>
+        /// <param name="columns">The terminal width in columns.</param>
+        /// <param name="rows">The terminal width in rows.</param>
+        /// <param name="width">The terminal width in pixels.</param>
+        /// <param name="height">The terminal height in pixels.</param>
+        /// <param name="bufferSize">The size of the buffer.</param>
+        /// <returns>
+        /// The created <see cref="ShellStream"/> instance.
+        /// </returns>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <remarks>
+        /// <para>
+        /// The <c>TERM</c> environment variable contains an identifier for the text window's capabilities.
+        /// You can get a detailed list of these capabilities by using the ‘infocmp’ command.
+        /// </para>
+        /// <para>
+        /// The column/row dimensions override the pixel dimensions(when nonzero). Pixel dimensions refer
+        /// to the drawable area of the window.
+        /// </para>
+        /// </remarks>
+        public ShellStream CreateShellStream(string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize);
+
+        /// <summary>
+        /// Creates the shell stream.
+        /// </summary>
+        /// <param name="terminalName">The <c>TERM</c> environment variable.</param>
+        /// <param name="columns">The terminal width in columns.</param>
+        /// <param name="rows">The terminal width in rows.</param>
+        /// <param name="width">The terminal width in pixels.</param>
+        /// <param name="height">The terminal height in pixels.</param>
+        /// <param name="bufferSize">The size of the buffer.</param>
+        /// <param name="terminalModeValues">The terminal mode values.</param>
+        /// <returns>
+        /// The created <see cref="ShellStream"/> instance.
+        /// </returns>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <remarks>
+        /// <para>
+        /// The <c>TERM</c> environment variable contains an identifier for the text window's capabilities.
+        /// You can get a detailed list of these capabilities by using the ‘infocmp’ command.
+        /// </para>
+        /// <para>
+        /// The column/row dimensions override the pixel dimensions(when non-zero). Pixel dimensions refer
+        /// to the drawable area of the window.
+        /// </para>
+        /// </remarks>
+        public ShellStream CreateShellStream(string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize, IDictionary<TerminalModes, uint>? terminalModeValues);
+
+        /// <summary>
+        /// Creates the shell stream without allocating a pseudo terminal,
+        /// similar to the <c>ssh -T</c> option.
+        /// </summary>
+        /// <param name="bufferSize">The size of the buffer.</param>
+        /// <returns>
+        /// The created <see cref="ShellStream"/> instance.
+        /// </returns>
+        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        public ShellStream CreateShellStreamNoTerminal(int bufferSize = -1);
+    }
+}

+ 18 - 202
src/Renci.SshNet/SshClient.cs

@@ -10,10 +10,8 @@ using Renci.SshNet.Common;
 
 namespace Renci.SshNet
 {
-    /// <summary>
-    /// Provides client connection to SSH server.
-    /// </summary>
-    public class SshClient : BaseClient
+    /// <inheritdoc cref="ISshClient" />
+    public class SshClient : BaseClient, ISshClient
     {
         /// <summary>
         /// Holds the list of forwarded ports.
@@ -30,9 +28,7 @@ namespace Renci.SshNet
 
         private MemoryStream? _inputStream;
 
-        /// <summary>
-        /// Gets the list of forwarded ports.
-        /// </summary>
+        /// <inheritdoc />
         public IEnumerable<ForwardedPort> ForwardedPorts
         {
             get
@@ -156,13 +152,7 @@ namespace Renci.SshNet
             }
         }
 
-        /// <summary>
-        /// Adds the forwarded port.
-        /// </summary>
-        /// <param name="port">The port.</param>
-        /// <exception cref="InvalidOperationException">Forwarded port is already added to a different client.</exception>
-        /// <exception cref="ArgumentNullException"><paramref name="port"/> is <see langword="null"/>.</exception>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <inheritdoc />
         public void AddForwardedPort(ForwardedPort port)
         {
             ThrowHelper.ThrowIfNull(port);
@@ -173,11 +163,7 @@ namespace Renci.SshNet
             _forwardedPorts.Add(port);
         }
 
-        /// <summary>
-        /// Stops and removes the forwarded port from the list.
-        /// </summary>
-        /// <param name="port">Forwarded port.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="port"/> is <see langword="null"/>.</exception>
+        /// <inheritdoc />
         public void RemoveForwardedPort(ForwardedPort port)
         {
             ThrowHelper.ThrowIfNull(port);
@@ -204,26 +190,13 @@ namespace Renci.SshNet
             port.Session = null;
         }
 
-        /// <summary>
-        /// Creates the command to be executed.
-        /// </summary>
-        /// <param name="commandText">The command text.</param>
-        /// <returns><see cref="SshCommand"/> object.</returns>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <inheritdoc />
         public SshCommand CreateCommand(string commandText)
         {
             return CreateCommand(commandText, ConnectionInfo.Encoding);
         }
 
-        /// <summary>
-        /// Creates the command to be executed with specified encoding.
-        /// </summary>
-        /// <param name="commandText">The command text.</param>
-        /// <param name="encoding">The encoding to use for results.</param>
-        /// <returns><see cref="SshCommand"/> object which uses specified encoding.</returns>
-        /// <remarks>This method will change current default encoding.</remarks>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
-        /// <exception cref="ArgumentNullException"><paramref name="commandText"/> or <paramref name="encoding"/> is <see langword="null"/>.</exception>
+        /// <inheritdoc />
         public SshCommand CreateCommand(string commandText, Encoding encoding)
         {
             EnsureSessionIsOpen();
@@ -232,17 +205,7 @@ namespace Renci.SshNet
             return new SshCommand(Session!, commandText, encoding);
         }
 
-        /// <summary>
-        /// Creates and executes the command.
-        /// </summary>
-        /// <param name="commandText">The command text.</param>
-        /// <returns>Returns an instance of <see cref="SshCommand"/> with execution results.</returns>
-        /// <remarks>This method internally uses asynchronous calls.</remarks>
-        /// <exception cref="ArgumentException">CommandText property is empty.</exception>
-        /// <exception cref="SshException">Invalid Operation - An existing channel was used to execute this command.</exception>
-        /// <exception cref="InvalidOperationException">Asynchronous operation is already in progress.</exception>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
-        /// <exception cref="ArgumentNullException"><paramref name="commandText"/> is <see langword="null"/>.</exception>
+        /// <inheritdoc />
         public SshCommand RunCommand(string commandText)
         {
             var cmd = CreateCommand(commandText);
@@ -250,23 +213,7 @@ namespace Renci.SshNet
             return cmd;
         }
 
-        /// <summary>
-        /// Creates the shell.
-        /// </summary>
-        /// <param name="input">The input.</param>
-        /// <param name="output">The output.</param>
-        /// <param name="extendedOutput">The extended output.</param>
-        /// <param name="terminalName">Name of the terminal.</param>
-        /// <param name="columns">The columns.</param>
-        /// <param name="rows">The rows.</param>
-        /// <param name="width">The width.</param>
-        /// <param name="height">The height.</param>
-        /// <param name="terminalModes">The terminal mode.</param>
-        /// <param name="bufferSize">Size of the internal read buffer.</param>
-        /// <returns>
-        /// Returns a representation of a <see cref="Shell" /> object.
-        /// </returns>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <inheritdoc />
         public Shell CreateShell(Stream input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint>? terminalModes, int bufferSize)
         {
             EnsureSessionIsOpen();
@@ -274,60 +221,19 @@ namespace Renci.SshNet
             return new Shell(Session, input, output, extendedOutput, terminalName, columns, rows, width, height, terminalModes, bufferSize);
         }
 
-        /// <summary>
-        /// Creates the shell.
-        /// </summary>
-        /// <param name="input">The input.</param>
-        /// <param name="output">The output.</param>
-        /// <param name="extendedOutput">The extended output.</param>
-        /// <param name="terminalName">Name of the terminal.</param>
-        /// <param name="columns">The columns.</param>
-        /// <param name="rows">The rows.</param>
-        /// <param name="width">The width.</param>
-        /// <param name="height">The height.</param>
-        /// <param name="terminalModes">The terminal mode.</param>
-        /// <returns>
-        /// Returns a representation of a <see cref="Shell" /> object.
-        /// </returns>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <inheritdoc />
         public Shell CreateShell(Stream input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint> terminalModes)
         {
             return CreateShell(input, output, extendedOutput, terminalName, columns, rows, width, height, terminalModes, 1024);
         }
 
-        /// <summary>
-        /// Creates the shell.
-        /// </summary>
-        /// <param name="input">The input.</param>
-        /// <param name="output">The output.</param>
-        /// <param name="extendedOutput">The extended output.</param>
-        /// <returns>
-        /// Returns a representation of a <see cref="Shell" /> object.
-        /// </returns>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <inheritdoc />
         public Shell CreateShell(Stream input, Stream output, Stream extendedOutput)
         {
             return CreateShell(input, output, extendedOutput, string.Empty, 0, 0, 0, 0, terminalModes: null, 1024);
         }
 
-        /// <summary>
-        /// Creates the shell.
-        /// </summary>
-        /// <param name="encoding">The encoding to use to send the input.</param>
-        /// <param name="input">The input.</param>
-        /// <param name="output">The output.</param>
-        /// <param name="extendedOutput">The extended output.</param>
-        /// <param name="terminalName">Name of the terminal.</param>
-        /// <param name="columns">The columns.</param>
-        /// <param name="rows">The rows.</param>
-        /// <param name="width">The width.</param>
-        /// <param name="height">The height.</param>
-        /// <param name="terminalModes">The terminal mode.</param>
-        /// <param name="bufferSize">Size of the internal read buffer.</param>
-        /// <returns>
-        /// Returns a representation of a <see cref="Shell" /> object.
-        /// </returns>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <inheritdoc />
         public Shell CreateShell(Encoding encoding, string input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint>? terminalModes, int bufferSize)
         {
             /*
@@ -347,56 +253,19 @@ namespace Renci.SshNet
             return CreateShell(_inputStream, output, extendedOutput, terminalName, columns, rows, width, height, terminalModes, bufferSize);
         }
 
-        /// <summary>
-        /// Creates the shell.
-        /// </summary>
-        /// <param name="encoding">The encoding.</param>
-        /// <param name="input">The input.</param>
-        /// <param name="output">The output.</param>
-        /// <param name="extendedOutput">The extended output.</param>
-        /// <param name="terminalName">Name of the terminal.</param>
-        /// <param name="columns">The columns.</param>
-        /// <param name="rows">The rows.</param>
-        /// <param name="width">The width.</param>
-        /// <param name="height">The height.</param>
-        /// <param name="terminalModes">The terminal modes.</param>
-        /// <returns>
-        /// Returns a representation of a <see cref="Shell" /> object.
-        /// </returns>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <inheritdoc />
         public Shell CreateShell(Encoding encoding, string input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint> terminalModes)
         {
             return CreateShell(encoding, input, output, extendedOutput, terminalName, columns, rows, width, height, terminalModes, 1024);
         }
 
-        /// <summary>
-        /// Creates the shell.
-        /// </summary>
-        /// <param name="encoding">The encoding.</param>
-        /// <param name="input">The input.</param>
-        /// <param name="output">The output.</param>
-        /// <param name="extendedOutput">The extended output.</param>
-        /// <returns>
-        /// Returns a representation of a <see cref="Shell" /> object.
-        /// </returns>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <inheritdoc />
         public Shell CreateShell(Encoding encoding, string input, Stream output, Stream extendedOutput)
         {
             return CreateShell(encoding, input, output, extendedOutput, string.Empty, 0, 0, 0, 0, terminalModes: null, 1024);
         }
 
-        /// <summary>
-        /// Creates the shell without allocating a pseudo terminal,
-        /// similar to the <c>ssh -T</c> option.
-        /// </summary>
-        /// <param name="input">The input.</param>
-        /// <param name="output">The output.</param>
-        /// <param name="extendedOutput">The extended output.</param>
-        /// <param name="bufferSize">Size of the internal read buffer.</param>
-        /// <returns>
-        /// Returns a representation of a <see cref="Shell" /> object.
-        /// </returns>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <inheritdoc />
         public Shell CreateShellNoTerminal(Stream input, Stream output, Stream extendedOutput, int bufferSize = -1)
         {
             EnsureSessionIsOpen();
@@ -404,58 +273,13 @@ namespace Renci.SshNet
             return new Shell(Session, input, output, extendedOutput, bufferSize);
         }
 
-        /// <summary>
-        /// Creates the shell stream.
-        /// </summary>
-        /// <param name="terminalName">The <c>TERM</c> environment variable.</param>
-        /// <param name="columns">The terminal width in columns.</param>
-        /// <param name="rows">The terminal width in rows.</param>
-        /// <param name="width">The terminal width in pixels.</param>
-        /// <param name="height">The terminal height in pixels.</param>
-        /// <param name="bufferSize">The size of the buffer.</param>
-        /// <returns>
-        /// The created <see cref="ShellStream"/> instance.
-        /// </returns>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
-        /// <remarks>
-        /// <para>
-        /// The <c>TERM</c> environment variable contains an identifier for the text window's capabilities.
-        /// You can get a detailed list of these capabilities by using the ‘infocmp’ command.
-        /// </para>
-        /// <para>
-        /// The column/row dimensions override the pixel dimensions(when nonzero). Pixel dimensions refer
-        /// to the drawable area of the window.
-        /// </para>
-        /// </remarks>
+        /// <inheritdoc />
         public ShellStream CreateShellStream(string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize)
         {
             return CreateShellStream(terminalName, columns, rows, width, height, bufferSize, terminalModeValues: null);
         }
 
-        /// <summary>
-        /// Creates the shell stream.
-        /// </summary>
-        /// <param name="terminalName">The <c>TERM</c> environment variable.</param>
-        /// <param name="columns">The terminal width in columns.</param>
-        /// <param name="rows">The terminal width in rows.</param>
-        /// <param name="width">The terminal width in pixels.</param>
-        /// <param name="height">The terminal height in pixels.</param>
-        /// <param name="bufferSize">The size of the buffer.</param>
-        /// <param name="terminalModeValues">The terminal mode values.</param>
-        /// <returns>
-        /// The created <see cref="ShellStream"/> instance.
-        /// </returns>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
-        /// <remarks>
-        /// <para>
-        /// The <c>TERM</c> environment variable contains an identifier for the text window's capabilities.
-        /// You can get a detailed list of these capabilities by using the ‘infocmp’ command.
-        /// </para>
-        /// <para>
-        /// The column/row dimensions override the pixel dimensions(when non-zero). Pixel dimensions refer
-        /// to the drawable area of the window.
-        /// </para>
-        /// </remarks>
+        /// <inheritdoc />
         public ShellStream CreateShellStream(string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize, IDictionary<TerminalModes, uint>? terminalModeValues)
         {
             EnsureSessionIsOpen();
@@ -463,15 +287,7 @@ namespace Renci.SshNet
             return ServiceFactory.CreateShellStream(Session, terminalName, columns, rows, width, height, terminalModeValues, bufferSize);
         }
 
-        /// <summary>
-        /// Creates the shell stream without allocating a pseudo terminal,
-        /// similar to the <c>ssh -T</c> option.
-        /// </summary>
-        /// <param name="bufferSize">The size of the buffer.</param>
-        /// <returns>
-        /// The created <see cref="ShellStream"/> instance.
-        /// </returns>
-        /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <inheritdoc />
         public ShellStream CreateShellStreamNoTerminal(int bufferSize = -1)
         {
             EnsureSessionIsOpen();