Re: Default ssh command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx"[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@xxxxxxxxxxx,curve25519-sha256,curve25519-sha256@xxxxxxxxxx,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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux