From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8747C47255 for ; Mon, 11 May 2020 15:34:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C655D206DB for ; Mon, 11 May 2020 15:34:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728084AbgEKPeR (ORCPT ); Mon, 11 May 2020 11:34:17 -0400 Received: from cloud.peff.net ([104.130.231.41]:43388 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726173AbgEKPeR (ORCPT ); Mon, 11 May 2020 11:34:17 -0400 Received: (qmail 7213 invoked by uid 109); 11 May 2020 15:34:17 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Mon, 11 May 2020 15:34:17 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 17666 invoked by uid 111); 11 May 2020 15:34:17 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Mon, 11 May 2020 11:34:17 -0400 Authentication-Results: peff.net; auth=none Date: Mon, 11 May 2020 11:34:16 -0400 From: Jeff King To: Ulrich Windl Cc: git@vger.kernel.org Subject: Re: Improving git's password prompt Message-ID: <20200511153416.GB1415@coredump.intra.peff.net> References: <5EB963AF020000A100038ECE@gwsmtp.uni-regensburg.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5EB963AF020000A100038ECE@gwsmtp.uni-regensburg.de> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, May 11, 2020 at 04:39:43PM +0200, Ulrich Windl wrote: > I'm aware that most repositories use "open HTTP" or SSH public key > authentication, but for the few cases where SSH with password is being > used, there is a minor probem like this: > --- > tester@host:~/iredir> git fetch > Password: > --- > > Now if you are working busily with the project you probably know where > the repository came from, what the username and password is, but if > you haven't worked with the repository for a while, it might be > helpful to see the username and host (the part up to ':' in the > display of "git remote -v", e.g.: "windl@server") with the password > prompt to select the correct password. > > So my proposal would be "Password for user@host:" instead of just > "Password:". > > Problem seen in git 2.26.1... That prompt is generated by ssh, not by git. Any git prompts do say "Password for user@host" or similar (e.g., what you see for http authentication). The best we can do is print "Connecting via ssh to host..." or similar before running ssh, which would give more context to the "Password" prompt. But would probably be annoying for people using key authentication (and we can't know which, because that decision is made internally by ssh). There might be a way to convince ssh to give a more descriptive prompt, but it looks like it may depend on the auth system used by the server. Some quick googling turns up: https://serverfault.com/questions/849906/how-to-display-userhostname-in-sshd-password-prompt -Peff