Provisioning issue with Trellis, Vagrant and Digital Ocean from Windows

Hi Guys, first post. Been trying to get the trellis > bedrock>sage stack to work using my windows 10 machine for the last few days. Im literally right at the end of the process, locally working fine, theme installed, bedrock features working…but I cannot deploy to staging.

As I understand it you must open a console at the trellis root folder (i use bitbash) and use vagrant to run commands for ansible to work on Windows:

To run the ansible-playbook commands to provision remote servers, you’ll need to SSH in to the VM, cd to the directory with your trellis files, then run the setup and deployment commands.

Am I doing this right?

example location to run provisioning ‘ansible-playbook server.yml -e env=staging’:
‘vagrant@site: ~/trellis’

and not:
‘user@windowsmachine: ~/trellis’

I also have cygwin set up for ssh but as I understand it bitbash is fine because I am using vagrant vm and I shouldnt need to use cygwin for provisioning or deployment.

This is the error I am getting:

jpols@MrComputer MINGW64 ~/Projects/recfishwa/trellis (master)
$ vagrant ssh
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-31-generic x86_64)

PLAY [Ensure necessary variables are defined] ************************************

TASK [Ensure environment is defined] *********************************************
skipping: [localhost]

PLAY [Test Connection and Determine Remote User] *********************************

TASK [connection : Require manual definition of remote-user] *********************
skipping: [188.166.218.143]

TASK [connection : Specify preferred HostKeyAlgorithms for unknown hosts] ********
skipping: [188.166.218.143]

TASK [connection : Check whether Ansible can connect as root] ********************
ok: [188.166.218.143 -> localhost]

TASK [connection : Warn about change in host keys] *******************************
skipping: [188.166.218.143]

TASK [connection : Set remote user for each host] ********************************
ok: [188.166.218.143]

TASK [connection : Announce which user was selected] *****************************
Note: Ansible will attempt connections as user = admin
ok: [188.166.218.143]

TASK [connection : Load become password] *****************************************
ok: [188.166.218.143]

PLAY [Install prerequisites] *****************************************************

TASK [Install Python 2.x] ********************************************************
System info:
Ansible 2.3.0.0; Linux
Trellis at “Add Vagrant config”

Failed to connect to the host via ssh: Permission denied
(publickey,password).

fatal: [188.166.218.143]: UNREACHABLE! => {“changed”: false, “unreachable”: true}
to retry, use: --limit @/home/vagrant/trellis/server.retry

PLAY RECAP ***********************************************************************
188.166.218.143 : ok=4 changed=0 unreachable=1 failed=0
localhost : ok=0 changed=0 unreachable=0 failed=0

I have been over the droplet setting and everything is configured correctly and since I have established I can login natively with ssh and just not with vagrant and I have reached a dead end, it seems like the droplet cannot find the key when connecting from vagrant?

vagrant@recfishwa:~/trellis$ ssh 187.166.218.143
Permission denied (publickey,password).

My question is this: I am doing this correctly with vagrant and why would I be able to connect with ssl on my native machine but not my vm? I am in the right place and is this what the docs mean by

Thanks, anyhelp appreciated I have been trying to resove this issue forover 12 hours and have probably been through all the posts and tutorials on the web!

Some Info on from the remote server:

  • grep ‘PermitRootLogin’ /etc/ssh/sshd_config: ‘yes’
  • grep ‘PasswordAuthentication’ /etc/ssh/sshd_config: ‘yes’ :
    PasswordAuthentification. Depending on your PAM config, PAM auth, then enable this but set PassWAuth.

Output of auth.log is (hand typed!):

vagrant@recfishwa:/$ ssh root@189.166.218.143
Permission denied (publickey).
vagrant@recfishwa:/$ ssh -l root 189.166.218.143 -p 22
Permission denied (publickey,password).

date staging-server sshd[2996]: Invalid user teamspeak from 196.195.251.69
’ ’ : input_userauth_request: invalid user teamspeak [preauth]
’ ’ : connection closed by 196.195.251.69
’ ‘: invalid user pi from 182.243.102.66
’ ’ : input_userauth_request: invalid user
’ ’ : error maximum authentication attempt exceeded for invalid user pi from 182.243.102.66 port 37976 ssh2 [preauth]
’ ’ : disconnecting: too many authentication failures
’ ’ : Invalid user 123 from 217.23.7.25
’ ’ : input_userauth_request: invalid user 123 [preauth]
’ ’ : Connection reset by 217.23.7.25 port 34744 [preauth]
’ ’ : Invalid user teamspeak from 196.195.251.69
’ ’ : input_userauth_request: invalid user teamspeak [preauth]
’ ’ : Connection closed by 217.23.7.25 port 44127[preauth]

AND

ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/vagrant/.ssh/id_rsa):
/home/vagrant/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/vagrant/.ssh/id_rsa.
Your public key has been saved in /home/vagrant/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:rRYkvu8zw8yXMtjuW9+aDuPtZ766a7g0 vagrant@recfishwa
The key’s randomart image is:
±–[RSA 2048]----+
| |
| |
| . . |
| . o . |

vagrant@recfishwa:~$ ssh-copy-id root@188.166.218.143

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: “/home/vagrant/.ssh/id_rsa.pub”
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed – if you are prompted now it is to install the new keys
Permission denied (publickey,password).