Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH ProxyCommand #33

Open
giancarlo100 opened this issue Mar 2, 2023 · 0 comments
Open

SSH ProxyCommand #33

giancarlo100 opened this issue Mar 2, 2023 · 0 comments

Comments

@giancarlo100
Copy link

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"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant