debops-wordpress icon indicating copy to clipboard operation
debops-wordpress copied to clipboard

Cant connect via SSH

Open andrewgoodnz opened this issue 10 years ago • 8 comments

Hi,

Spinning up a new EC2 instance which I am able to connect to using ssh [email protected] however when I run debops -u ubuntu -vvvv I get the following:

Andrews-MacBook-Pro:qfp-debops andrewgood$ debops -u ubuntu -vvvv
Running Ansible playbook from:
/usr/local/share/debops/debops-playbooks/playbooks/site.yml ...
Using /Users/andrewgood/Bitbucket/qfp-debops/ansible.cfg as config file
[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user and make sure become_method is 'sudo' (default).
This 
feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in 
ansible.cfg.
Loaded callback default of type stdout, v2.0

PLAYBOOK: site.yml *************************************************************
66 plays in /usr/local/share/debops/debops-playbooks/playbooks/site.yml

PLAY [Prepare core environment] ************************************************

TASK [setup] *******************************************************************
<fqdn.com> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<fqdn.com> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 -o ControlPath=/Users/andrewgood/.ansible/cp/ansible-ssh-%h-%p-%r fqdn.com '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1467688291.16-108695322470383 `" && echo ansible-tmp-1467688291.16-108695322470383="` echo $HOME/.ansible/tmp/ansible-tmp-1467688291.16-108695322470383 `" ) && sleep 0'"'"''
fatal: [fqdn.com]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh.", "unreachable": true}
    to retry, use: --limit @/usr/local/share/debops/debops-playbooks/playbooks/site.retry

PLAY RECAP *********************************************************************
fqdn.com : ok=0    changed=0    unreachable=1    failed=0   

TASK: setup ------------------------------------------------------------- 0.89s

DNS is set to point to the correct IP address for the FQDN so struggling to understand whats happening!

Other things I have tried:

  • debops-update
  • Fresh clone of this repo

andrewgoodnz avatar Jul 05 '16 03:07 andrewgoodnz

I had similar errors on using google cloud

solutions:

refresh the domain ip, in case u recently changed that make sure that the "ubuntu" user can do ssh on a new terminal window

aelsharawi avatar Jul 05 '16 11:07 aelsharawi

Like @aelsharawi said, can you ssh to the server with the ubuntu user?

carlalexander avatar Jul 05 '16 12:07 carlalexander

Yes, I am able to successfully login using ssh [email protected]

andrewgoodnz avatar Jul 05 '16 18:07 andrewgoodnz

The best way to solve this issue is to edit your ~/.ssh/config file and add the SSL file for the server. Mine looked like this:

Host fqdn.com
  IdentityFile ~/path/to/fqdn.com.pem

I never had any problems once I did that. That said, AWS support isn't working right now. I've started running tests on AWS. The official ticket is #92.

carlalexander avatar Sep 03 '16 12:09 carlalexander

Did this help @andrewgoodnz?

carlalexander avatar Oct 05 '16 21:10 carlalexander

I am having problem on vagrant provision fatal: [npro]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh.", "unreachable": true}

Can somebody help?

nehajyoti04 avatar Nov 10 '16 09:11 nehajyoti04

You should probably open a new issue for this @nehajyoti04.

I've been working on a Docker dev environment for DebOps. It won't work out of the box. First of all, you have to make sure that Ansible knows that you're connecting to itself. That means using something like localhost ansible_connection=local in your hosts file.

carlalexander avatar Nov 10 '16 13:11 carlalexander

Going to close this. Please reopen if you're still having problems @andrewgoodnz! 😄

carlalexander avatar Mar 10 '17 12:03 carlalexander