Skip to content

SSH ProxyCommand #33

@giancarlo100

Description

@giancarlo100

i need to use this proxy command for ssh :
-o ProxyCommand="ssh -i RUNDECK_KEY -o StrictHostKeyChecking=no -W %h:%p -q xxxx@server.loca.it"

when try it i have this error:
Warning: Identity file -o not accessible: No such file or directory.
Bad stdio forwarding specification '%h:%p'
Failed: NonZeroResultCode: [ssh-exec] Result code: 255

i solved it in dis way:

#finally, use exec to pass along exit code of the SSH command
/usr/bin/dos2unix $SSH_KEY_STORAGE_PATH >/dev/null 2>&1
BH_SSH_KEY=$( echo "$SSH_KEY_STORAGE_PATH" | sed 's///\//g')
RUNSSH=$(echo $RUNSSH | sed "s/RUNDECK_KEY/$BH_SSH_KEY/g")
eval $RUNSSH

#Path for ssh proxy command
/usr/bin/dos2unix $SSH_KEY_STORAGE_PATH >/dev/null 2>&1
BH_SSH_KEY=$( echo "$SSH_KEY_STORAGE_PATH" | sed 's///\//g')
RUNSCP=$(echo $RUNSCP | sed "s/RUNDECK_KEY/$BH_SSH_KEY/g")

#finally, execute scp but don't print to STDOUT
eval $RUNSCP

It is possible to add this solution in the next release

Node configuration:
node-executor: 'ssh-exec'
file-copier: 'ssh-copier'
ssh-authentication: privatekey
ssh-key-storage-path: 'keys/project/Infrastruttura/BH_Satellite'
ssh-options: '-o ProxyCommand="ssh -i RUNDECK_KEY -o StrictHostKeyChecking=no -W %h:%p -q xxxx@server.loca.it"'

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