-
-
Notifications
You must be signed in to change notification settings - Fork 967
Open
Description
SSH.NET 2025.0.0
I'm executing a command on a ssh session to a router that takes some time to complete. I get a System.Exception after 30 seconds no matter what I've set timeouts to:
long_running_script.sh:
#!/bin/sh
echo Simulating a long running operation
sleep 45
echo Doneshort_running_script.sh:
#!/bin/sh
echo Simulating a quick operation
sleep 5
echo Donevar sshClient = new SshClient("192.168.1.1", "root", password);
sshClient.ConnectionInfo.Timeout = TimeSpan.FromSeconds(60);
sshClient.ConnectionInfo.ChannelCloseTimeout = TimeSpan.FromSeconds(60);
sshClient.Connect();
var cmd = sshClient.CreateCommand(". /home/user/long_running_script.sh");
cmd.CommandTimeout = TimeSpan.FromSeconds(60);
var res = cmd.Execute();This throws a generic System.Exception after 30 seconds. No further information, no inner exception. If I call short_running_script.sh instead it works fine.
Metadata
Metadata
Assignees
Labels
No labels