Jump to content
OMRON Forums

SSH Timeout


JeffB
 Share

Recommended Posts

This ended up moving to email and likely has been resolved.

It seems like it's some settings in Linux--specifically "ClientAliveCountMax" and "ClientAliveInterval" in the file located in "/.readonly/etc/ssh/sshd_config".

Increasing these variables should increase the timeout before the ssh session is closed.

(Alternately, setting ClientAliveInterval to 0 should disable this timeout altogether)

Link to comment
Share on other sites

  • 2 months later...

Option 1

When you edit the values in the IDE a linux file with the correct settings is created, but it will not survive reboot. You can move this file to the saved location to make changes permeant. This can be done from the IDE terminal.

System mount -o remount,rw
System cp /.readonly/etc/ssh/ssh_config /.readonly/etc/ssh/ssh_config_backup
System cp /etc/ssh/ssh_config /.readonly/etc/ssh/ssh_config
System mount -o remount,ro /

Option 2

Add just the alive interval.

System mount –o remount,rw /
System sed -ie '/^Host */a ClientAliveInterval 0' /.readonly/etc/ssh/ssh_config
System mount –o remount,ro /

Option 3

Add all needed lines to the file. This can be done through Putty.

mount -o remount,rw
nano /.readonly/etc/ssh/ssh_config
[Move to end of file with arrow keys]
[Paste with right click]
[Ctrl-X, Y, ENTER]
mount -o remount,ro /

These are the lines to paste. Change X to an integer or leave it out.

ClientAliveCountMax X
ClientAliveInterval 0


 

  • Thanks 1
Link to comment
Share on other sites

43 minutes ago, Eric Hotchkiss said:

When you edit the values in the IDE a linux file with the correct settings is created, but it will not survive reboot. You can move this file to the saved location to make changes permeant. To do this:

mount -o remount,rw
cp /.readonly/etc/ssh/ssh_config /.readonly/etc/ssh/ssh_config_backup
cp /etc/ssh/ssh_config /.readonly/etc/ssh/ssh_config
mount -o remount,ro /

Another option would be to add only the needed lines to the file

mount -o remount,rw
nano /.readonly/etc/ssh/ssh_config
[Paste with right click]
[Ctrl-X, Y, ENTER]
mount -o remount,ro /

These are the lines to paste. Change X to an integer or leave it out.

ClientAliveCountMax X
ClientAliveInterval 0


 

 

2.PNG

Link to comment
Share on other sites

  • 8 months later...

I'm executing a script connecting via password-less SSH on a remote host. I want to set a timeout, so that if the remote host is taking an infinite time to run, I want to come out of that ssh session and continue other lines in my sh script.

How can I set a timeout?

Edited by CharlesCarter
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...