0

I have a laptop running Ubuntu server with Plex (Server runs on WiFi (2.4 GHz)). When sshing into the server it usually works but randomly (like after 40min) it says host down despite laptop still running and I have to reboot the server to use ssh again.

*Edit- I have noticed a pattern this usually happens when I disconnect from ssh by typing exit and after 10min minutes or more it says host down... etc the only solution I can do is to run htop or any other command to stop it from disconnecting.

onlysaikihere@hub: $ client_loop: ssh_packet_write_poll: Connection to 192.168.0.145 port 22: Host is down
sahishnukumar@Sahishnu-kumar ~ % ssh onlysaikihere0192.168.0.145
ssh: connect to host 192.168.0.145 port 22: Host is down
sahishnukumar@Sahishnu-kumar ~ % ssh onlysaikihere@192.168.0.145
ssh: connect to host 192.168.0.145 port 22: Host is down
sahishnukumar@Sahishnu-kumar ~ % ssh onlysaikihere0192.168.0.145
ATTA
AC
sahishnukumar@Sahishnu-kumar
~ % ssh onlysaikihere@192.168.0.145

using mosh gives following output

sahishnukumar@Sahishnu-kumar ~ % mosh onlysaikihere@192.168.0.145
/opt/homebrew/bin/mosh: Could not connect to 192.168.0.145, last tried 192.168.0.145: Host is down
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535
/opt/homebrew/bin/mosh: Did not find remote IP address (is SSH ProxyCommand disabled?).
sahishnukumar@Sahishnu-kumar ~ % 

plex server also stop working

FORMATTED LAPTOP AND ISSUE FIXED

4
  • Check the logs on the server. The problem is probably on the server. On the laptop, sudo journalctl -b 0 -u NetworkManager may supply more information.
    – waltinator
    Jan 11 at 18:07
  • Please copy/paste and format text instead of pictures of text. A picture (of text) can't be read on a text-only terminal, can't be copied from (edited, tried, and made to work), AND makes one take an action to even read your Question. Since we're all volunteers, some won't.
    – waltinator
    Jan 11 at 18:10
  • @waltinator updated it by adding text ,log is too long pastebin.com/Jd2ZUNnC Jan 11 at 18:25
  • You can get more info with ssh -v .... Also, for unstable connections you could use mosh on top of ssh. Jan 11 at 18:42
0

Try setting SSH up for regular pings:

Host *
    ServerAliveInterval 60

Add this to the top of your ~/.ssh/config and sessions should no longer drop. The default, larger interval does not prevent that from happening.

5
  • the file was empty for me , I added this to the top "Host * ServerAliveInterval 60" Jan 11 at 18:30
  • @RetroXcalibur Did it work?
    – mchid
    Jan 11 at 18:42
  • @mchid sorry I wasn't able to reply, I went to sleep , I left ssh on with yt-dlp downloading playlist and when I woke up ssh was up and connected so I guess this fixed it as I was connected to server for 8 hours Jan 12 at 2:42
  • the problem started again. Jan 12 at 15:20
  • Maybe your Wi-Fi was inactive long enough to skip some keep-alives, such as by being in sleep mode.
    – alamar
    Jan 12 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.