Skip to content

ssh-copier not work on SSH proxy scenario #24

@molinacarlos

Description

@molinacarlos

Version: openssh-node-execution-2.0.1

Using node definition that use bastion host / jump host scenario

<node name="presvricm06" hostname="10.2.235.245" osArch="amd64" osFamily="unix" osName="Linux" osVersion="Centos 7.7" username="root" ssh-authentication="privateKey" ssh-key-storage-path="keys/XXX/YYYzzz.privkey" local-ssh-agent="true" ssh-options='-o ConnectTimeout=10 -o ProxyCommand="ssh -W %h:%p root@172.16.13.77"' />

I am using the followinf job definition to test the case:

<joblist> <job> <defaultTab>output</defaultTab> <description></description> <dispatch> <excludePrecedence>true</excludePrecedence> <keepgoing>false</keepgoing> <rankOrder>ascending</rankOrder> <successOnEmptyNodeFilter>false</successOnEmptyNodeFilter> <threadcount>1</threadcount> </dispatch> <executionEnabled>true</executionEnabled> <group>POC bastion host</group> <id>17e9037b-2d35-4372-a436-f7d8cd16ec45</id> <loglevel>INFO</loglevel> <name>POC bastion host</name> <nodeFilterEditable>false</nodeFilterEditable> <nodefilters> <filter>name: server.*</filter> </nodefilters> <nodesSelectedByDefault>true</nodesSelectedByDefault> <plugins /> <scheduleEnabled>true</scheduleEnabled> <sequence keepgoing='false' strategy='parallel'> <command> <description>Ejecucion</description> <fileExtension>sh</fileExtension> <scriptargs /> <scriptfile>/datos/test.sh</scriptfile> <scriptinterpreter>/bin/bash</scriptinterpreter> </command> </sequence> <uuid>17e9037b-2d35-4372-a436-f7d8cd16ec45</uuid> </job> </joblist>

Running job, I got the following error

unknown option -- W usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2

Making some debug on /var/lib/rundeck/libext/cache/openssh-node-execution-2.0.1/ssh-copy.sh I got the following facts

'
89: SSHOPTS='-p -P 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=quiet -o ConnectTimeout=10 -o ProxyCommand="ssh -W %h:%p root@172.16.13.77" -i /tmp/.ssh-exec/ssh-keyfile.root@10.240.238.245.uqEUi'
94: RUNSCP='scp -p -P 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=quiet -o ConnectTimeout=10 -o ProxyCommand="ssh -W %h:%p root@172.16.13.77" -i /tmp/.ssh-exec/ssh-keyfile.root@10.240.238.245.uqEUi /datos/test.sh root@10.240.238.245:/tmp/13-5697-presvricm06-test.sh'
96: [[ -n '' ]]
107: [[ -n '' ]]
119: [[ password == \p\r\i\v\a\t\e\k\e\y ]]
135: [[ true == '' ]]
141: unset RD_CONFIG_SSH_KEY_STORAGE_PATH
142: unset RD_NODEEXECUTOR_SSH_KEY_STORAGE_PATH
143: unset RD_NODEEXECUTOR_SSH_KEY_PASSPHRASE_STORAGE_PATH
144: unset RD_CONFIG_SSH_PASSWORD_STORAGE_PATH
145: unset RD_NODEEXECUTOR_SSH_PASSWORD_STORAGE_PATH
148: scp -p -P 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=quiet -o ConnectTimeout=10 -o 'ProxyCommand="ssh' -W %h:%p 'root@172.16.13.77"' -i /tmp/.ssh-exec/ssh-keyfile.root@10.240.238.245.uqEUi /datos/test.sh root@10.240.238.245:/tmp/13-5697-presvricm06-test.sh
unknown option -- W
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2
148: exit 1
'
Note single quotes (') on line 148 --> o 'ProxyCommand="ssh' -W %h:%p 'root@172.16.13.77"'

These single quotes are different that RUNSCP variable is built on line 94.

Any ideas to fix or address this issue?

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions