| Summary: | The sshd log files are insufficient to detect sessions | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Felix von Leitner <felix-mindrot> | ||||
| Component: | sshd | Assignee: | Assigned to nobody <unassigned-bugs> | ||||
| Status: | CLOSED FIXED | ||||||
| Severity: | enhancement | CC: | djm, dtucker | ||||
| Priority: | P5 | ||||||
| Version: | 7.1p1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| See Also: | https://bugzilla.mindrot.org/show_bug.cgi?id=2741 | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 2451 | ||||||
| Attachments: |
|
||||||
|
Description
Felix von Leitner
2015-11-20 22:16:30 AEDT
Created attachment 2765 [details]
include port number in more places
Loglevel=verbose already gives you most of the information you want:
Dec 11 13:26:53 fuyu sshd[14096]: Connection from 203.217.30.82 port 36726 on 203.217.30.81 port 22
Dec 11 13:26:54 fuyu sshd[14096]: Postponed publickey for djm from 203.217.30.82 port 36726 ssh2 [preauth]
Dec 11 13:26:58 fuyu sshd[14096]: Accepted publickey for djm from 203.217.30.82 port 36726 ssh2: ECDSA SHA256:LmoNaxGFFurT6S2Q67RFuuxIq4is0rVLLdkt6Qgvy66E
Dec 11 13:26:58 fuyu sshd[14096]: User child is on pid 17347
Dec 11 13:26:58 fuyu sshd[17347]: Starting session: shell on ttyp2 for djm from 203.217.30.82 port 36726
Dec 11 13:27:13 fuyu sshd[17347]: Received disconnect from 203.217.30.82: 11: disconnected by user
Dec 11 13:27:13 fuyu sshd[17347]: Disconnected from 203.217.30.82
That being said, we could include the port in disconnect messages.
Comment on attachment 2765 [details]
include port number in more places
ok, but I think we should also explicitly cache these values as early as practical (ie just after accept, and just after the inetd/reexec handling) to minimise the chance they'll vanish by the time they're needed.
The caching is already triggered as soon as the packet code is informed of the connection fds. See https://anongit.mindrot.org/openssh.git/tree/packet.c?id=39736be06c#n298 Anyway, patch is applied - this will be in OpenSSH 7.2. It looks like this now: Dec 11 14:28:29 fuyu sshd[15956]: Connection from 203.217.30.82 port 38485 on 203.217.30.81 port 22 Dec 11 14:28:30 fuyu sshd[15956]: Postponed publickey for djm from 203.217.30.82 port 38485 ssh2 [preauth] Dec 11 14:28:32 fuyu sshd[15956]: Accepted publickey for djm from 203.217.30.82 port 38485 ssh2: ECDSA SHA256:LmoNaxGFFurT6S2Q67RFuuxIq4is0rVLLdkt6Qgvy66E Dec 11 14:28:32 fuyu sshd[15956]: User child is on pid 26320 Dec 11 14:28:32 fuyu sshd[26320]: Starting session: shell on ttyp3 for djm from 203.217.30.82 port 38485 Dec 11 14:28:38 fuyu sshd[26320]: Received disconnect from 203.217.30.82 port 38485:11: disconnected by user Dec 11 14:28:38 fuyu sshd[26320]: Disconnected from 203.217.30.82 port 38485 Close all resolved bugs after 7.3p1 release |