From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102649 invoked by alias); 13 Feb 2019 10:32:06 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 102639 invoked by uid 89); 13 Feb 2019 10:32:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-100.9 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Stewart, stewart, DOMAIN, Hx-spam-relays-external:sk:mrelaye X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.17.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Feb 2019 10:32:04 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MUGmL-1gSXXW29Df-00RIn3 for ; Wed, 13 Feb 2019 11:32:01 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id DBCC9A8071B; Wed, 13 Feb 2019 11:32:00 +0100 (CET) Date: Wed, 13 Feb 2019 10:32:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: sshd: computer name's case must match? Message-ID: <20190213103200.GK3718@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="E7i4zwmWs5DOuDSH" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-02/txt/msg00113.txt.bz2 --E7i4zwmWs5DOuDSH Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1692 On Feb 12 16:07, Bill Stewart wrote: > Good day, >=20 > I am testing sshd using the cygwin1.dll 3.x version (run as SYSTEM - > S4U logon - works great!). >=20 > One thing I've noticed is that if I use ssh log onto a remote > domain-joined machine (e.g., connect with COMPUTER+localname), the > 'COMPUTER' prefix must be uppercase - if I specify > 'computer+LocalName', the user is unknown. >=20 > This doesn't seem to be the case if I change the username's case - > 'COMPUTER+localname' also works. >=20 > Is this by design or by accident? sshd checks usernames case-sensitive against their name stored in the user DB. The problem that you can use differently cased usernames here is that the Windows function for checking the name is case- insensitive, so it takes the username any way it comes in and sshd eventually checks against the wrongly cased name. I fixed that partially in Cygwin by making sure that the account name stored in the internal passwd/group info is stored case-correct: https://cygwin.com/git/?p=3Dnewlib-cygwin.git;a=3Dcommitdiff;h=3D9a3cc77b2a= fc So if you have a domain DOMAIN and a user xyz $ getent passwd DoMaIn+XyZ Prior to the above patch it returned DOMAIN+XyZ:... Now it will return DOMAIN+xyz:... The problem is this: If the account is from another domain than the local machine or the machine domain, the call to LookupAccountSid to fix the account name won't fix the account name. Apparently the account name is cached on the local machine in exactly the same spelling as has been used when asking for the account the first time. I still have to find a way to workaround that. Thanks, Corinna --=20 Corinna Vinschen Cygwin Maintainer --E7i4zwmWs5DOuDSH Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxj8iAACgkQ9TYGna5E T6CE6w/+LjSHlZ1ANvgjpRJ+rS235xP/j3/Yz7Um3pGPzcAl18bm7/RgG+zW8BxB teAOtXilkipQ/KmIaKxypURQjelDw/Yd5JrUEGfr9eZuJnJwk4eKaysLw7nb0Kbx Jc5S1kXjcRm0li7kh5rMISBTfYthPQhZ0pm1nX1Jo7ZDKg2Wf7oXbdAiljxpjEx4 0+ZR5XilGaMmdLx27I3errgyK26d5UEVQvLYt6ao5xkFZfx6kOMRd5eBKbu1Zznz CxoUj6Z8GRsUTEmrHfhSTFuGlZyARtAdTA3yaI6X7th2anelL1clgvZNrIrkCxuZ 88B1ZAG+FmNefP1G8JS6EhqiOtJT36bTnGefcad/Bvf7EywjNkMr/Ot0nhJtQ85+ orzzKYNiDdK0IoywPekJ2qQa4lO5am8WRL3zE+RwTVRu54jL4HB0mT8+Kh9ycNC7 8q+Z1x04Bzu6HV752AGTiOcCyNy3Wo+SpE2vbeKVzB3+yZR9n5QRat5LzuNZQrAZ tEWoOBFNvakjT38vokeZQGBTUPoOqYrx8bpBGVuA+ICStDlIwXP3F+1zKVrAdYPi UkuZmVZ6u1EaDqI3DL9d1LCPYD9ZsX/mHa6DWisfocPtjKUJ2M5vJDcEz5LiLdMl SH+IlKGjBmDjBfctvyRAyeo8azyLQxALADa+32OLwZ05kNw4Gys= =K2vT -----END PGP SIGNATURE----- --E7i4zwmWs5DOuDSH--