Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to stop ssh sessions timing out

if you connect to another pc via ssh, you may notice that after a period of inactivity, that the ssh session idles and disconnects you (you cannot type anymore in the cosole for example)


to get around this, simply edit the following file as below and add the following line to auto ping a packet (keepalive as it were)


vi /etc/ssh/sshd_config

in the file add the following line: ClientAliveInterval 30

example below:-

#       $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $
# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.
Port 22
ClientAliveInterval 30
#Protocol 2,1
#ListenAddress ::


save ( ESC :wq )


and restart your sshd server


service sshd restart





Forum Jump:

Users browsing this thread: 1 Guest(s)