I have a device connected to my home network that wants to SSH via WireGuard VPN Peer. The VPN subnet is 10.0.0.x/24.
The issue is:
- I can successfully connect to the device via SSH.
- The SSH session works fine initially but disconnects after about 1 minute.
- After the disconnect, I have to reconnect manually.
What I’ve tried so far
- Lowered the MTU on the WireGuard interface (Ubuntu server side) to
1280→ no effect. - Checked
/etc/ssh/sshd_configfor any timeout-related flags. I also tried adding:
Rebooted the server → no effect.ClientAliveInterval 30 ClientAliveCountMax 3 - Verified that the WireGuard client has
PersistentKeepalive = 25configured. - General network connection seems stable (no packet loss outside of SSH).
- Tried to get verbose logs via
ssh -vvbut it just freezes the terminal without handing any log value
Question
How can I prevent SSH sessions from dropping after ~1 minute over?
tcpdump -i ifname -n tcp port 22on both sides (intmux/screen) to see what is going on. Is the SSH connection from one wireguard endpoint to the other or are more (logical) network sections involved? Setting the MTU would be enough only from endpoint to endpoint. Otherwise you need MSS rewrite innft/iptables.systemctl restart sshd. Rebooting is for upgrading kernels or device driver modules. Or for when the kernel's got itself into a weird state due to hardware errors - e.g. stuck re-reading bad sectors on a disk, or spurious pci bus errors from a dodgy wifi card or similar. Or when you've locked yourself out of a remote system due to user error (like killing sshd or fail2ban-ing your SRC IP).ServerAliveIntervalin the client rather than bothering with the ClientAlive settings in the server. There are network devices that will still break your connection, but it's fairly rare. Are you sure something on the server isn't noticing the login and killing the processes after a minute?