I was wondering if I should start a new thread, or revive a 2 years old thread that has a similar issue, but not exactly the same… Here's to a new thread based on :
https://forums.freebsd.org/threads/49411/
I have two PCs with each a static IP4 connected to the Internet via a dynamic IP router. The local PC (FreeBSD 10.1-RELEASE) knows the IP4 of the remote PC (FreeBSD 10.3-RELEASE) through dynamic DNS scripts (that I wrote, and will gladly share with you when I take the time to clean them up).
The local PC can connect to the remote PC via ssh(1) without any problem, even for days/weeks without requiring the need for the remote PC from being rebooted. SSH connections can be up to a few hours, then I close them using
The problem I encounter happened twice already, and I would like fix it or work around it. In the SSH shell, I click the up-arrow to recall an older command that I typed, then SSH becomes unresponsive after I type ENTER to execute my selected command. No SSH logon is possible after that. Surprisingly, pinging the remote PC on its own LAN works.
To my knowledge, /var/log/messages and /var/log/security didn't have anything out of the ordinary on the first occurrence of the problem, after I rebooted the remote PC. I'll also check /var/log/debug.log and /var/log/auth.log this time just in case.
I'm considering setting LogLevel to DEBUG3 temporarily (for a few days until the problem occurs again) in sshd_config. This setting is not recommended for user privacy. What does that mean? Too much info in log files? If so, I can always delete the log files after resetting this option to default.
A long time ago:
Perhaps I could check for some memory leaks by SSH itself and do a preventing stop/start SSH or a reboot of the PC when the problem is about to happen? What should I check for such issues? ps(1)?
Anything else?
Dominique.
https://forums.freebsd.org/threads/49411/
I have two PCs with each a static IP4 connected to the Internet via a dynamic IP router. The local PC (FreeBSD 10.1-RELEASE) knows the IP4 of the remote PC (FreeBSD 10.3-RELEASE) through dynamic DNS scripts (that I wrote, and will gladly share with you when I take the time to clean them up).
The local PC can connect to the remote PC via ssh(1) without any problem, even for days/weeks without requiring the need for the remote PC from being rebooted. SSH connections can be up to a few hours, then I close them using
CTRL-D
when I'm done (so less files are opened should a power outage occur). I do kill the processes that tunnel TCP ports via SSH that I created because they no longer work when I come back at a later time. My Internet connection is not permanent.The problem I encounter happened twice already, and I would like fix it or work around it. In the SSH shell, I click the up-arrow to recall an older command that I typed, then SSH becomes unresponsive after I type ENTER to execute my selected command. No SSH logon is possible after that. Surprisingly, pinging the remote PC on its own LAN works.
Code:
% ssh -vvv -C -4 ruser@1.2.3.4
OpenSSH_6.6.1p1, OpenSSL 1.0.1j-freebsd 15 Oct 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: ciphers ok: [snip]
debug2: ssh_connect: needpriv 0
debug1: Connecting to 1.2.3.4 [1.2.3.4] port 2000.
debug1: Connection established.
debug1: identity file /home/luser/.ssh/id_rsa type -1
debug1: identity file /home/luser/.ssh/id_rsa-cert type -1
debug1: identity file /home/luser/.ssh/id_dsa type -1
debug1: identity file /home/luser/.ssh/id_dsa-cert type -1
debug1: identity file /home/luser/.ssh/id_ecdsa type -1
debug1: identity file /home/luser/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/luser/.ssh/id_ed25519 type -1
debug1: identity file /home/luser/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1_hpn13v11 FreeBSD-20140420
Code:
% telnet -4 1.2.3.4 2000
Trying 1.2.3.4...
Connected to abc.def.com.
Escape character is '^]'.
To my knowledge, /var/log/messages and /var/log/security didn't have anything out of the ordinary on the first occurrence of the problem, after I rebooted the remote PC. I'll also check /var/log/debug.log and /var/log/auth.log this time just in case.
I'm considering setting LogLevel to DEBUG3 temporarily (for a few days until the problem occurs again) in sshd_config. This setting is not recommended for user privacy. What does that mean? Too much info in log files? If so, I can always delete the log files after resetting this option to default.
A long time ago:
The host may be having an issue. I've had this happen on a few heavily loaded servers. You'd get the banner but everything else just stalls. It could be disk related, if one drive has failed for example, the system would block everything and waits indefinitely for the disk to respond to I/O. It's also possible the server has run out of memory, and I mean really run out, no memory free and a full swap. That would also result in connections seemingly hanging.
Perhaps I could check for some memory leaks by SSH itself and do a preventing stop/start SSH or a reboot of the PC when the problem is about to happen? What should I check for such issues? ps(1)?
Anything else?
Dominique.