https://docs.paramiko.org/en/stable/api/channel.html?highlight=exec_command exec_command(command) Execute a command on the server. If the server allows it, the channel will then be directly connected to the stdin, stdout, and stderr of the command being executed.
When the command finishes executing, the channel will be closed and can’t be reused. You must open a new channel if you wish to execute another command.
Parameters command (str) – a shell command to execute.
Raises SSHException – if the request was rejected or the channel was closed