[Bug 2824] Add a configuration option / hook that will enable running a shell command / script right before connecting

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Sun Jan 28 04:38:01 AEDT 2018


https://bugzilla.mindrot.org/show_bug.cgi?id=2824

--- Comment #2 from Doron Behar <doron.behar at gmail.com> ---
That's an interesting idea, I had no idea the `ProxyCommand` was there
when I
wrote this request but I'm not sure it is possible to actually make it
work.

>From what I understand from `ssh_config(5)`, the directive
`ProxyCommand` can
be used to eventually replace the default `ssh` command (the client
program)
and connect to an `sshd` server by itself.

I tried adding to `~/.ssh/config` the following:

    ProxyCommand /usr/bin/gpg-connect-agent UPDATESTARTUPTTY /bye &&
ssh -p %p %r@%h

with `ssh -vvv` the result was the following:

        OpenSSH_7.6p1, OpenSSL 1.1.0g  2 Nov 2017
        debug1: Reading configuration data /home/doron/.ssh/config
        debug1: Reading configuration data
/home/doron/.ssh/config.d/hosts/LAN
        debug1: Reading configuration data
/home/doron/.ssh/config.d/hosts/git
        debug1: /home/doron/.ssh/config.d/hosts/git line 1: Applying
options for github.com
        debug1: Reading configuration data
/home/doron/.ssh/config.d/hosts/vps
        debug1: Reading configuration data /etc/ssh/ssh_config
        debug1: Executing proxy command: exec
/usr/bin/gpg-connect-agent UPDATESTARTUPTTY /bye && ssh -vvv -p 22
git at github.com
        debug1: permanently_drop_suid: 1000
        debug1: identity file /home/doron/.ssh/github type 0
        debug1: key_load_public: No such file or directory
        debug1: identity file /home/doron/.ssh/github-cert type -1
        debug1: Local version string SSH-2.0-OpenSSH_7.6
        debug1: ssh_exchange_identification: OK

        ssh_exchange_identification: Connection closed by remote host

I tried replacing `;` with `&&` and the result was the same and in both
cases
no connection was established.

I also tried putting a `ProxyCommand` that is calling a shell script
that runs
those two commands (with the `TOKENS`) and I received the following
error (the
same line repeats itself until I `^c`):

        Pseudo-terminal will not be allocated because stdin is not a
terminal.

Is it even possible to have `gpg-connect-agent UPDATESTARTUPTTY /bye`
run
automatically with `ProxyCommand` the way I wanted?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list