From nobody Wed Feb 09 11:56:49 2022 X-Original-To: hackers@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 BACCF19A78A9 for ; Wed, 9 Feb 2022 11:57:03 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.evolve.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JtyzL3XfQz4tJ6; Wed, 9 Feb 2022 11:57:02 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: by mail.evolve.de (OpenSMTPD) with ESMTP id 148b7285; Wed, 9 Feb 2022 11:56:53 +0000 (UTC) Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id 2af07ad6 (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Wed, 9 Feb 2022 11:56:51 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org Mime-Version: 1.0 (1.0) Subject: Re: Behavior of /dev/pts in a jail? From: Michael Gmelin In-Reply-To: <20220209113737.Horde.8QntfZV4xEkYdmHjXMgCpHN@webmail.leidinger.net> Date: Wed, 9 Feb 2022 12:56:49 +0100 Cc: hackers@freebsd.org Message-Id: <77267259-0758-4C04-867D-77A896D133E4@freebsd.org> References: <20220209113737.Horde.8QntfZV4xEkYdmHjXMgCpHN@webmail.leidinger.net> To: Alexander Leidinger X-Mailer: iPhone Mail (19C63) X-Rspamd-Queue-Id: 4JtyzL3XfQz4tJ6 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 213.239.217.29 is neither permitted nor denied by domain of grembo@freebsd.org) smtp.mailfrom=grembo@freebsd.org X-Spamd-Result: default: False [-1.59 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[grembo]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-0.998]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.998]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-0.99)[-0.993]; MLMMJ_DEST(0.00)[hackers]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N > On 9. Feb 2022, at 11:38, Alexander Leidinger wr= ote: >=20 > =EF=BB=BFQuoting Michael Gmelin (from Tue, 8 Feb 2022= 13:37:32 +0100): >=20 >> I've seen a similar problem with jails running on top of bhyve (in that >> case, doing ssh wouldn't work). >>=20 >> The solution back then was to add ttyu* to devfs rules _before_ starting >> the jail: >>=20 >> devfs rule -s 3 add 3250 path "ttyu*" unhide >>=20 >> Not sure if what you're seeing is related, but it feels a bit like that. >>=20 >> See also >> https://lists.freebsd.org/archives/freebsd-current/2021-August/000409.htm= l >=20 > I tried that now. It doesn't help. I'm not really surprised, as there is n= o ttyu* device visible on the host itself (serial devices disabled in bios).= >=20 > Bye, > Alexander. >=20 Hi Alex, I was able to reproduce the issue locally. The problem is caused by jexec inheriting the pty from the jail host. If you use a pty that was created inside of the jail, gpg-agent/pinentry wor= ks as expected. This can be accomplished, e.g., by running tmux inside of the jail: jexec gpgtest pkg install tmux tmux gpg --gen-key Running sshd inside of the jail and connecting to it using ssh has the same e= ffect. Cheers Michael