sshが古すぎる場合は、ssh-configオプションを条件付きでスキップしますか?

sshが古すぎる場合は、ssh-configオプションを条件付きでスキップしますか?

どのように使用SetEnvして他のシステムと同じ構成を使用できますが、~/.ssh/configサポートするには古すぎる場合はエラーは発生しませんか?ssh

Match exec設定が古すぎる場合(OpenSSH < 7.8)、設定を除外するステートメントを追加してみました。ssh

Host server.example.com webhost
    User jacktose
    HostName server239.example.com
Match host "server.example.com webhost" exec "ssh -V 2>&1 | sed -nE '/^OpenSSH_(7\.(8|9|\d\d+)|(8|9|\d\d+\.))/!{q7}'"
    SetEnv LANG=C

SetEnvただし、その行が解析され、エラーが発生しているようです。

$ ssh -vvv anyhost
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
...
debug2: checking match for 'host "server.example.com webhost" exec "ssh -V 2>&1 | sed -nE '/^OpenSSH_(7\\.(8|9|\\d\\d+)|(8|9|\\d\\d+\\.))/!{q7}'"' host anyhost originally anyhost
debug3: /home/jacktose/.ssh/config line 37: not matched 'host "anyhost"' 
debug3: /home/jacktose/.ssh/config line 37: skipped exec "ssh -V 2>&1 | sed -nE '/^OpenSSH_(7\\.(8|9|\\d\\d+)|(8|9|\\d\\d+\\.))/!{q7}'"
debug2: match not found
/home/jacktose/.ssh/config: line 38: Bad configuration option: setenv
...
/home/jacktose/.ssh/config: terminating, 1 bad configuration options

ベストアンサー1

おすすめ記事