Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SSH connections randomly hang [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ardro
n00b
n00b


Joined: 06 Apr 2021
Posts: 3

PostPosted: Wed Apr 07, 2021 3:06 am    Post subject: SSH connections randomly hang [SOLVED] Reply with quote

I have recently installed gentoo on a new machine and have been having trouble with sshd. I am experiencing an intermittent issue where connections to this server will appear to time out, and must be force-killed by the client. There is no pattern to this, it has timed out in the middle of compiling a kernel, and when left idle for 10 minutes. I've also left an ssh session open overnight, and come back ~7 hours later to find it working correctly.

At first I thought this was probably a driver issue so I installed another NIC, but I am getting the same errors with it as well. I am fairly certain it is not the network, as I have another gentoo server hooked up to the same switch that has been running for ~3 years without trouble.

The two NICs I have tried are a Realtek RTL8111G integrated in my motherboard, and an HP NC365T.

I'm using static IP addresses, this is my /etc/conf.d/net
Code:
config_enp9s0="10.0.0.33/24"
#routes_enp9s0="default via 10.0.0.1"

config_enp1s0f0="10.0.0.34/24"
routes_enp1s0f0="default via 10.0.0.1"


When I connect with the ssh -vvv flag this is the output I get around where it hangs.
Code:
debug2: shell request accepted on channel 0
me@gen3 ~ $ jklfasdebug2: channel 0: filter stops
debug2: channel 0: read failed
debug2: channel 0: chan_shutdown_read (i0 o0 sock -1 wfd 4 efd 6 [write])
debug2: channel 0: input open -> drain
debug3: send packet: type 1
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i1/0 o0/0 e[write]/4 fd -1/5/6 sock -1 cc -1)

debug3: fd 1 is not O_NONBLOCK
Connection to 10.0.0.34 closed.
Transferred: sent 9440, received 9648 bytes, in 672.7 seconds
Bytes per second: sent 14.0, received 14.3
debug1: Exit status -


All output after "me@gen3 ~ $ jklfas" is printed after I kill the client with enter+~+.

I'm not really sure how to proceed with troubleshooting this, any suggestions would be appreciated.


Last edited by ardro on Thu Apr 15, 2021 8:41 am; edited 1 time in total
Back to top
View user's profile Send private message
ardro
n00b
n00b


Joined: 06 Apr 2021
Posts: 3

PostPosted: Wed Apr 07, 2021 7:40 am    Post subject: Reply with quote

I believe that I fixed this by using DHCP. I'm not sure why I was having problems with a static IP, as I tried at least 5 distinct IPs after checking with arp-scan to avoid an address conflict.
Seems to be working now though, I'll just assign a static IP through my router.
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 534
Location: France

PostPosted: Wed Apr 07, 2021 6:28 pm    Post subject: Reply with quote

Hi.

Had same problem when from home, and went with this tip from a colleague:
Code:

$ cat ~/.ssh/config
ServerAliveInterval 10
ServerAliveCountMax 10


++
Gi)
Back to top
View user's profile Send private message
ardro
n00b
n00b


Joined: 06 Apr 2021
Posts: 3

PostPosted: Tue Apr 13, 2021 9:04 pm    Post subject: Reply with quote

Thanks for the suggestion guitou.

I didn't want to modify the ssh client settings because I was more concerned about why it was disconnecting. I was setting this machine up as a NAS, and I didn't want to run into any trouble down the line when in the middle of large file transfers. The SSH timeouts were just the only visible representation of the network issues I was having at the time.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum