From nobody Tue Mar 05 21:03:35 2024 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tq7Mh013gz5DQcv for ; Tue, 5 Mar 2024 21:03:44 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [IPv6:2607:f3e0:0:1::12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smarthost1.sentex.ca", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tq7Mg1gM2z4qd5 for ; Tue, 5 Mar 2024 21:03:43 +0000 (UTC) (envelope-from mike@sentex.net) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mike@sentex.net designates 2607:f3e0:0:1::12 as permitted sender) smtp.mailfrom=mike@sentex.net Received: from pyroxene2a.sentex.ca (pyroxene19.sentex.ca [199.212.134.19]) by smarthost1.sentex.ca (8.17.1/8.16.1) with ESMTPS id 425L3ZoO017833 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=FAIL); Tue, 5 Mar 2024 16:03:36 -0500 (EST) (envelope-from mike@sentex.net) Received: from [IPV6:2607:f3e0:0:4:cce0:f75:6fc7:b856] ([IPv6:2607:f3e0:0:4:cce0:f75:6fc7:b856]) by pyroxene2a.sentex.ca (8.17.1/8.15.2) with ESMTPS id 425L3YAp047276 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 5 Mar 2024 16:03:34 -0500 (EST) (envelope-from mike@sentex.net) Message-ID: <3c5a230c-e776-4ff1-a396-3e3c182af056@sentex.net> Date: Tue, 5 Mar 2024 16:03:35 -0500 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: FreeBSD Questions From: mike tancsa Subject: sftp chroot RELENG_14 vs RELENG_13 broken? Autocrypt: addr=mike@sentex.net; keydata= xsBNBFywzOMBCACoNFpwi5MeyEREiCeHtbm6pZJI/HnO+wXdCAWtZkS49weOoVyUj5BEXRZP xflV2ib2hflX4nXqhenaNiia4iaZ9ft3I1ebd7GEbGnsWCvAnob5MvDZyStDAuRxPJK1ya/s +6rOvr+eQiXYNVvfBhrCfrtR/esSkitBGxhUkBjOti8QwzD71JVF5YaOjBAs7jZUKyLGj0kW yDg4jUndudWU7G2yc9GwpHJ9aRSUN8e/mWdIogK0v+QBHfv/dsI6zVB7YuxCC9Fx8WPwfhDH VZC4kdYCQWKXrm7yb4TiVdBh5kgvlO9q3js1yYdfR1x8mjK2bH2RSv4bV3zkNmsDCIxjABEB AAHNHW1pa2UgdGFuY3NhIDxtaWtlQHNlbnRleC5uZXQ+wsCOBBMBCAA4FiEEmuvCXT0aY6hs 4SbWeVOEFl5WrMgFAl+pQfkCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQeVOEFl5W rMiN6ggAk3H5vk8QnbvGbb4sinxZt/wDetgk0AOR9NRmtTnPaW+sIJEfGBOz47Xih+f7uWJS j+uvc9Ewn2Z7n8z3ZHJlLAByLVLtcNXGoRIGJ27tevfOaNqgJHBPbFOcXCBBFTx4MYMM4iAZ cDT5vsBTSaM36JZFtHZBKkuFEItbA/N8ZQSHKdTYMIA7A3OCLGbJBqloQ8SlW4MkTzKX4u7R yefAYQ0h20x9IqC5Ju8IsYRFacVZconT16KS81IBceO42vXTN0VexbVF2rZIx3v/NT75r6Vw 0FlXVB1lXOHKydRA2NeleS4NEG2vWqy/9Boj0itMfNDlOhkrA/0DcCurMpnpbM7ATQRcsMzk AQgA1Dpo/xWS66MaOJLwA28sKNMwkEk1Yjs+okOXDOu1F+0qvgE8sVmrOOPvvWr4axtKRSG1 t2QUiZ/ZkW/x/+t0nrM39EANV1VncuQZ1ceIiwTJFqGZQ8kb0+BNkwuNVFHRgXm1qzAJweEt RdsCMohB+H7BL5LGCVG5JaU0lqFU9pFP40HxEbyzxjsZgSE8LwkI6wcu0BLv6K6cLm0EiHPO l5G8kgRi38PS7/6s3R8QDsEtbGsYy6O82k3zSLIjuDBwA9GRaeigGppTxzAHVjf5o9KKu4O7 gC2KKVHPegbXS+GK7DU0fjzX57H5bZ6komE5eY4p3oWT/CwVPSGfPs8jOwARAQABwsB2BBgB CAAgFiEEmuvCXT0aY6hs4SbWeVOEFl5WrMgFAl+pQfkCGwwACgkQeVOEFl5WrMiVqwf9GwU8 c6cylknZX8QwlsVudTC8xr/L17JA84wf03k3d4wxP7bqy5AYy7jboZMbgWXngAE/HPQU95NM aukysSnknzoIpC96XZJ0okLBXVS6Y0ylZQ+HrbIhMpuQPoDweoF5F9wKrsHRoDaUK1VR706X rwm4HUzh7Jk+auuMYfuCh0FVlFBEuiJWMLhg/5WCmcRfiuB6F59ZcUQrwLEZeNhF2XJV4KwB Tlg7HCWO/sy1foE5noaMyACjAtAQE9p5kGYaj+DuRhPdWUTsHNuqrhikzIZd2rrcMid+ktb0 NvtvswzMO059z1YGMtGSqQ4srCArju+XHIdTFdiIYbd7+jeehg== Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.37 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.98)[-0.981]; R_SPF_ALLOW(-0.20)[+ip6:2607:f3e0::/32]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[199.212.134.19:received]; XM_UA_NO_VERSION(0.01)[]; RCPT_COUNT_ONE(0.00)[1]; FREEFALL_USER(0.00)[mike]; ASN(0.00)[asn:11647, ipnet:2607:f3e0::/32, country:CA]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[sentex.net]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4Tq7Mg1gM2z4qd5 Hi all,     Trying to stand up a new vm with RELENG_14 and cant for some reason get chrooted logging working with the sftp server built into the base openssh. On a RELENG_13 box, the following config works Match user testuser1    ChrootDirectory %h    ForceCommand internal-sftp -f local1 -l verbose    AllowTcpForwarding no    PermitTunnel no    X11Forwarding no    PermitTTY no and I have full logging of what the client sends as commands to the server. e.g. Mar  5 15:30:03 vm1c sshd[70518]: Received disconnect from 127.0.0.1 port 18574:11: disconnected by user Mar  5 15:30:03 vm1c sshd[70518]: Disconnected from user testuser1 127.0.0.1 port 18574 Mar  5 15:32:33 vm1c sshd[70459]: Received signal 15; terminating. Mar  5 15:32:33 vm1c sshd[70659]: Server listening on 127.0.0.1 port 22. Mar  5 15:32:33 vm1c sshd[70659]: Server listening on 10.187.2.97 port 22. Mar  5 15:32:35 vm1c sshd[70662]: Connection from 127.0.0.1 port 14265 on 127.0.0.1 port 22 Mar  5 15:32:35 vm1c sshd[70662]: Accepted key RSA SHA256:nh.. found at /home/testuser1/.ssh/authorized_keys:2 Mar  5 15:32:35 vm1c sshd[70662]: Postponed publickey for testuser1 from 127.0.0.1 port 14265 ssh2 [preauth] Mar  5 15:32:36 vm1c sshd[70662]: Accepted key RSA SHA256:nh.. found at /home/testuser1/.ssh/authorized_keys:2 Mar  5 15:32:36 vm1c sshd[70662]: Accepted publickey for testuser1 from 127.0.0.1 port 14265 ssh2: RSA SHA256:nh.... Mar  5 15:32:36 vm1c sshd[70662]: User child is on pid 70664 Mar  5 15:32:36 vm1c sshd[70664]: Starting session: forced-command (config) 'internal-sftp -f local1 -l verbose' for testuser1 from 127.0.0.1 port 14265 id 0 Mar  5 15:32:36 vm1c internal-sftp[70665]: session opened for local user testuser1 from [127.0.0.1] Mar  5 15:32:36 vm1c internal-sftp[70665]: received client version 3 Mar  5 15:32:36 vm1c internal-sftp[70665]: realpath "." Mar  5 15:32:37 vm1c internal-sftp[70665]: opendir "/home/testuser1" Mar  5 15:32:37 vm1c internal-sftp[70665]: closedir "/home/testuser1" Mar  5 15:32:37 vm1c internal-sftp[70665]: users-groups-by-id: 4 users, 0 groups Mar  5 15:32:37 vm1c internal-sftp[70665]: session closed for local user testuser1 from [127.0.0.1] In /home/testuser1, I have /dev/ and a hard link to the log socket on the same partition # pwd /home/testuser1/dev # ln /home/var/run/log . and syslog was started as so syslogd -s -p /var/run/log -p /home/var/run/log However, on RELENG14 I cant get any sftp commands to log if I chroot the daemon The last messages I see are Mar  5 15:37:55 vm1c sshd[71034]: Accepted key RSA SHA256:nh.. found at /home/testuser1/.ssh/authorized_keys:2 Mar  5 15:37:55 vm1c sshd[71034]: Accepted publickey for testuser1 from 127.0.0.1 port 30728 ssh2: RSA SHA256:nhi.. I dont see the "Starting session: forced-command" line ever logged. I tried creating a simple RELENG_13 jail on the RELENG14 box and I see the same behaviour. So I am guessing its not something in userland ?  If so, any ideas what it might be ?     ---Mike