1

I'm using a jump box (server A) to access server B.

As per the ansible docs here, I have the following:

ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q [email protected]"'

Server B is, let's say: 10.0.2.54

I run:

ansible-playbook staging.yml -i staging_hosts --private-key=~/.ssh/mykeys.pem -vvvv

And the result is:

fatal: [10.0.2.54]: UNREACHABLE! => {"changed": false, "msg": "All    items completed", "results":
[{"item": ["openssl"], "msg": "ERROR! SSH encountered an unknown error.
The output was:\nOpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011\ndebug1:
Reading configuration data /etc/ssh_config\r\ndebug1: /etc/ssh_config  line 20: Applying options for *\r\ndebug2:
ssh_connect: needpriv 0\r\ndebug1:
Executing proxy command: exec ssh -W 10.0.2.54:22 -q ec2- [email protected]\r\ndebug3:
timeout: 10000 ms remain after connect\r\ndebug3: Incorrect RSA1   identifier\r\ndebug3:
Could not load \"/Users/me/.ssh/mykeys.pem\" as a RSA1 public key\r\ndebug1:
permanently_drop_suid: 501\r\ndebug1: identity file    /Users/me/.ssh/mykeys.pem type -1\r\ndebug1:
identity file /Users/me/.ssh/mykeys.pem-cert type -1\r\ndebug1:
Enabling compatibility mode for protocol 2.0\r\ndebug1:
Local version string SSH-2.0-  OpenSSH_6.2\r\nssh_exchange_identification:
Connection closed by remote host\r\n", "unreachable": true}]}
3
  • can you connect from command line?
    – Jakuje
    Jan 28, 2016 at 18:51
  • yes (thanks) so not sure why this isn't working with ansible :|
    – rix
    Jan 29, 2016 at 0:47
  • In your log, I see there is space in "ec2- user". Is it typo or wrong-copied log?
    – Jakuje
    Jan 29, 2016 at 7:42

1 Answer 1

0

May it be that you need to define an SSH key for the jump server A? If that's the case, try to change the SSH args line to:

ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q -i <path_to_jumphost_keyfile> [email protected]"'
1
  • Hi, welcome to ServerFault! In the OPs output I see "/Users/me/.ssh/mykeys.pem", so I think it's more likely that the SSH key is provided, but not readable.
    – jornane
    May 13, 2016 at 8:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .