how to fix ssh timeout problems
来源:互联网 发布:mysql大小写敏感开关 编辑:程序博客网 时间:2024/06/10 20:16
How to fix ssh timeout problems
If you use ssh a lot, you may have noticed that your ssh session times out and you’re logged out every once in a while. Annoying isn’t it?
Read from remote host ocaoimh.ie: Connection reset by peer
Connection to ocaoimh.ie closed.
There’s a quick fix for that. Actually, there are 2 ways to fix it. You only need to do one of them so choose whichever one is easiest for you. You’ll need root access, so for most people it’s probably safer to do the client fix rather than the server fix.
- On the server, login as root and edit /etc/ssh/sshd_config and add the line:
ClientAliveInterval 60
According to
man sshd_config
, this line,Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. This option applies to protocol version 2 only.
Don’t forget to restart sshd on the server after you save the file.
- The other way, and easier and safer way is for your desktop machine to send those keep alive messages. As root on your desktop (or client) machine, edit /etc/ssh/ssh_config and add the line:
ServerAliveInterval 60
That will send send a message to the server every 60 seconds, keeping the connection open. I prefer this way because I login to several machines every day, and I don’t have root access to all of them.
I knew I had blogged about ssh timeout problems before, but I hadn’t mentioned the client fix so it’s worth a revisit!
- how to fix ssh timeout problems
- How to disable SSH timeout
- How to disable SSH timeout
- How to troubleshoot memory problems
- How to Fix Msvbvm50.dll
- How to fix oozie problem
- Using VisualVM to fix live Tomcat and JVM problems
- Some wrong ways to fix audio problems in Ubuntu
- How to resolve Common "Windows Installer" Problems
- How to Solve Problems in Computer Vision?
- How to change the timeout in FXCop
- Siebel Config: How to set Session Timeout?
- How-to disable the before-session timeout
- How to configue session timeout in Hive
- Reminder: how to fix winxp search bug
- How to Fix GIP.Trojan Windows Error
- How to fix QX File Extension
- how to fix error 25007 : loadlibraryshim()
- JAXB Hello World
- Android百度地图相关内容汇总
- 动态性能视图与数据字典的区别之一
- C#基于SOCKET通信开发的Telnet模拟工具
- @CookieValue注解 拿到cookie
- how to fix ssh timeout problems
- 虚数的意义
- poj 1787 DP
- 外键消除表连接
- myeclipse6.6+maven跑springside4.1的demo
- linux设备驱动开发详解--第八章 Linux 设备驱动中的阻塞与非阻塞 I/O
- eclipse 配置maven web项目
- windows svn(TortoiseSVN)命令操作
- coreseek增加自定义中文分词