git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Aaron Hall <aaronchallmba@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Default ssh command
Date: Wed, 7 Jul 2021 13:29:26 +0000	[thread overview]
Message-ID: <YOWsNk4GqNUPyHD5@camp.crustytoothpaste.net> (raw)
In-Reply-To: <CADrEZfEVbtbovTbFM2BEuK_cWp4jcV3CZyrzasvsvFbuu1rmWg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2967 bytes --]

On 2021-07-07 at 02:13:34, Aaron Hall wrote:
> > When we use ssh to run the receive-pack over the wire while pushing,
> > we do not ask for pty, and because the "-e" option to set the escape
> > character is meaningful only when ssh runs with pty allocated, you
> > shouldn't have to do this, unless you force pty allocation by
> > e.g. passing "-t" yourself.
> 
> Then I wonder why I'm getting a pseudoterminal.
> 
> Note that I'm using git from git bash on Windows in a walled off
> corporate environment.

Do you maybe have RequestTTY set in some SSH configuration file, like
~/.ssh/config?  You can also run "ssh -vvv HOSTNAME" to see if there are
any config files.

For example, if I do "ssh -vvv git@github.com"[0], I see these lines:

  debug1: Reading configuration data /home/bmc/.ssh/config
  debug1: /home/bmc/.ssh/config line 44: Applying options for github.com
  debug1: /home/bmc/.ssh/config line 67: Applying options for *
  debug3: kex names ok: [sntrup4591761x25519-sha512@tinyssh.org,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256]
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
  debug1: /etc/ssh/ssh_config line 21: Applying options for *

That tells me I have some configuration for github.com (and for all
hosts) in ~/.ssh/config and some for all hosts in /etc/ssh/ssh_config.
It doesn't tell me what they are, but I can look in the files to see.

Also, you may wish to run "env | grep '^GIT'" to see if anybody has
configured the GIT_SSH or GIT_SSH_COMMAND variables, and check with "git
config -l --show-origin" to see if someone has overridden the SSH
configuration.

> The ssh manpage says:
> 
> > If no pseudo-terminal has been allocated, the session is transparent
> > and can be used to reliably transfer binary data.  On most
> > systems, setting the escape character to ``none'' will also
> > make the session transparent even if a tty is used.
> 
> If we want the ssh to be binary transparent regardless
> (and I think we do) then that makes my suggestion,
> `ssh -e none`, still perhaps a good one?

The problem is that on some systems "ssh" is something other than
OpenSSH and we will likely break those systems.  That doesn't mean we
can't do it if it's necessary, but it does mean that if this is a
configuration issue, it would be better to fix the configuration if we
can rather than potentially break systems needlessly.

This problem will also occur for tools like rsync and various other
programs which expect the standard behavior for the ssh binary, so
making a change here in Git is also not the right place if we can avoid
it.

[0] Chosen simply because I know it works, it has configuration on my
system, and it's publicly accessible.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2021-07-07 13:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  1:35 Default ssh command Aaron Hall
2021-07-07  1:48 ` Junio C Hamano
     [not found]   ` <CADrEZfGHAi=Lr6QMsJbXGy1Rs9VDzTVxQPNH4xHHj6ataEAvVA@mail.gmail.com>
     [not found]     ` <CADrEZfHJZT47nNZJ8v2T4vOJkMN7ccaai6DKdzFLF8Zoc42hWw@mail.gmail.com>
2021-07-07  2:13       ` Aaron Hall
2021-07-07 13:29         ` brian m. carlson [this message]
2021-07-08 13:50           ` Aaron Hall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YOWsNk4GqNUPyHD5@camp.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=aaronchallmba@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).