- 新しい順
- 投票が多い順
- コメントが多い順
Hey Alex,
I would suggest to make the changes as below on the client and server side.
- Client-side settings —————————————————————— To avoid session timeout for a user, we edit the ~/.ssh/config file. So, in this configuration file, we add the following code. Host * ServerAliveInterval 300 ServerAliveCountMax 2
Timeout value = ClientAliveInterval * ClientAliveCountMax =600seconds = 10 Minutes
This indicates that a null packet is sent to the server every 300 seconds twice to keep the session alive. 2. Sever-side settings ———————————————————————— Similarly, server-side settings also affect all client connections. Hence, to make such a change, we edit the configuration file. In the /etc/ssh/sshd_config file we add the following. KeepAlive yes ClientAliveInterval 300 ClientAliveCountMax 2 These settings make the server send a null packet every 300 seconds. It shows a timeout after trying for two times.
-
- Restart the ssh service after setting the values. # service sshd restart
Suggestions
- Monitor the connection. If it still drops, gradually decrease the ServerAliveInterval setting in the config file until the connection is stable.
- I would also suggest to have a look at this article which explains to keep running SSH session using screen or tux command. https://www.ubuntupit.com/how-to-keep-remote-ssh-sessions-running-after-disconnection/
I am using MOBAXTERM now. Solved all ssh issue. Its permanently ON. Also i can edit better with that Amazon ssh console. Amazon should create better SSH terminal that needs to "wow" people with its developer centric stuff. SSH terminal should be able to open multiple instance in two side views and copy paste should be a click like in mobaxterm. Best is though each instance should be its own drive so client side editor like visual code can work on it directly. It improves productivity
関連するコンテンツ
- AWS公式更新しました 7ヶ月前
Sorry i am using only ssh from amazon lightsail webpage. its server side? what is client side. Anyway it do not work at all now. it used to work in the beginning. But somewhere something changed