Where does RasPiOS put log files related to ssh connections?
I've got a Pi4 that's dropping individual ssh connections. One
particular connection out of a dozen or so drops, so it's
probably related to the server end, not the client.
It'd be helpful to examine the client log for clues, but
the logging setup on RasPiOS is very different from
BSD and and I'm unsure where to look.
The only message displayed on LxTerminal at the RasPiOS end is
.....
client_loop: send disconnect: Broken pipe
.....
Thanks for reading, and any guidance!
bob prohaska
Where does RasPiOS put log files related to ssh connections?
I've got a Pi4 that's dropping individual ssh connections. One
particular connection out of a dozen or so drops, so it's
probably related to the server end, not the client.
It'd be helpful to examine the client log for clues, but
the logging setup on RasPiOS is very different from
BSD and and I'm unsure where to look.
The only message displayed on LxTerminal at the RasPiOS end is
.....
client_loop: send disconnect: Broken pipe
.....
Thanks for reading, and any guidance!
On 1/12/24 08:14, bob prohaska wrote:
Where does RasPiOS put log files related to ssh connections?
I've got a Pi4 that's dropping individual ssh connections. One
particular connection out of a dozen or so drops, so it's
probably related to the server end, not the client.
It'd be helpful to examine the client log for clues, but
the logging setup on RasPiOS is very different from
BSD and and I'm unsure where to look.
The only message displayed on LxTerminal at the RasPiOS end is
.....
client_loop: send disconnect: Broken pipe
.....
Thanks for reading, and any guidance!
bob prohaska
In the journal.
journalctl -u ssh
will get you what you want. Also be sure to look at the man page for journalctl.
Is there a list of valid unit names somewhere?
Many thanks!
bob prohaska
That's a good start. The -u ssh arguments seem to produce records
of ssh server activity but nothing about outgoing client connections.
In my case the problem is with an outgoing (client) session. The
journalctl -u ssh command reported no ssh client activity at all.
Is there a list of valid unit names somewhere?
That's a good start. The -u ssh arguments seem to produce records
of ssh server activity but nothing about outgoing client connections.
In my case the problem is with an outgoing (client) session. The
journalctl -u ssh command reported no ssh client activity at all.
Is there a list of valid unit names somewhere?
bob prohaska <bp@www.zefox.net> wrote:
I've got a Pi4 that's dropping individual ssh connections. One
particular connection out of a dozen or so drops, so it's
probably related to the server end, not the client.
But usually a broken pipe means the TCP socket dropped for some reason,
which is not the fault of SSH. It can be due to aggressive timeouts on NAT routers - mobile networks are notorious for that. Search for 'ssh
keepalive' for details of how to make SSH send null packets back and forth every so often to prevent timeouts.
It could also be wifi related, if the wifi dropped out for some while then eventually the TCP connection would drop.
If you affected by TCP drops, 'mosh' is a tool that runs on top of SSH that automatically reconnects and maintains the connection as it was before. It also does things like caching keystrokes and replaying them when the connection comes back up.
Theo
bob prohaska <bp@www.zefox.net> writes:
That's a good start. The -u ssh arguments seem to produce records
of ssh server activity but nothing about outgoing client connections.
In my case the problem is with an outgoing (client) session. The
journalctl -u ssh command reported no ssh client activity at all.
The client doesn?t normally log to the journal. Run your client with
?ssh -vvv? for debug logging from the client . However Theo has already interpreted the diagnostic; you?re probably not going to get much more
out of it than that.
Server logging seems to be quite thin by default. You could try
increasing the LogLevel in /etc/ssh/sshd_config (see ?man sshd_config?
for possible values). You?ll need to restart the server for this to take effect (systemctl restart ssh).
However, empirically, it doesn?t seem to have much to say when a
connection is terminated abnormally, so don?t get your hopes up.
I think Theo is probably right about what?s going on here.
Is there a list of valid unit names somewhere?
systemctl list-units
Sysop: | Weed Hopper |
---|---|
Location: | Clearwater, FL |
Users: | 14 |
Nodes: | 6 (0 / 6) |
Uptime: | 231:45:19 |
Calls: | 55 |
Calls today: | 1 |
Files: | 50,127 |
D/L today: |
34 files (4,425K bytes) |
Messages: | 275,362 |