trailofbits / algo

Set up a personal VPN in the cloud
https://blog.trailofbits.com/2016/12/12/meet-algo-the-vpn-that-works/
GNU Affero General Public License v3.0
28.65k stars 2.31k forks source link

Locally run install script cannot connect to own VM server #250

Closed zacc closed 7 years ago

zacc commented 7 years ago

OS / Environment

Server: Ubuntu 16.04 Host: Linux Mint 17.3

Ansible version

2.2.0.0

Version of components from requirements.txt

adal==0.4.4 ansible==2.2.0.0 apache-libcloud==1.5.0 azure==2.0.0rc5 azure-batch==0.30.0rc5 azure-common==1.1.4 azure-graphrbac==0.30.0rc5 azure-mgmt==0.30.0rc5 azure-mgmt-authorization==0.30.0rc5 azure-mgmt-batch==0.30.0rc5 azure-mgmt-cdn==0.30.0rc5 azure-mgmt-cognitiveservices==0.30.0rc5 azure-mgmt-commerce==0.30.0rc5 azure-mgmt-compute==0.30.0rc5 azure-mgmt-keyvault==0.30.0rc5 azure-mgmt-logic==0.30.0rc5 azure-mgmt-network==0.30.0rc5 azure-mgmt-notificationhubs==0.30.0rc5 azure-mgmt-nspkg==1.0.0 azure-mgmt-powerbiembedded==0.30.0rc5 azure-mgmt-redis==0.30.0rc5 azure-mgmt-resource==0.30.0rc5 azure-mgmt-scheduler==0.30.0rc5 azure-mgmt-storage==0.30.0rc5 azure-mgmt-web==0.30.0rc5 azure-nspkg==1.0.0 azure-servicebus==0.20.2 azure-servicemanagement-legacy==0.20.3 azure-storage==0.32.0 boto==2.45.0 boto3==1.4.4 botocore==1.5.14 certifi==2017.1.23 cffi==1.9.1 cryptography==1.7.2 docutils==0.13.1 dopy==0.3.5 enum34==1.1.6 futures==3.0.5 idna==2.2 ipaddress==1.0.18 isodate==0.5.4 Jinja2==2.8 jmespath==0.9.1 keyring==10.2 MarkupSafe==0.23 msrest==0.4.5 msrestazure==0.4.7 oauthlib==2.0.1 paramiko==2.1.1 pyasn1==0.2.2 pycparser==2.17 pycrypto==2.6.1 PyJWT==1.4.2 pyOpenSSL==16.2.0 python-dateutil==2.6.0 PyYAML==3.12 requests==2.13.0 requests-oauthlib==0.8.0 s3transfer==0.1.10 SecretStorage==2.3.1 six==1.10.0

Summary of the problem

While running the algo script locally to install VPN on a remote, existing Ubuntu VPS server, the script fails to connect to the server

Steps to reproduce the behavior

  1. Run ./algo script
  2. Enter remote server's IP address, etc.

Installation starts but fails when trying to connect to the remote server

The way of deployment (cloud or local)

cloud

Expected behavior

Some kind of password prompt when it attempts to connect to the remote server

Actual behavior

Script stops

Full log

<-- LOG truncated, starts at steps that contact server -->


< PLAY [Configure the server and install required software] >

    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||

< TASK [Install prerequisites] >

    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||

fatal: []: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '' (RSA) to the list of known hosts.\r\nPermission denied (publickey,password).\r\n", "unreachable": true}


< PLAY RECAP >

    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||
: ok=0 changed=0 unreachable=1 failed=0 localhost : ok=6 changed=1 unreachable=0 failed=0
dguido commented 7 years ago

It will work if you setup a pubkey for that ssh user on your remote host. Will find a way to address this in docs later.

lgg commented 7 years ago

@dguido maybe i misunderstand you, but:

cd configs
cat algo.pem.pub | ssh root@188.166.88.144 -i algo.pem "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"

didn't help, still get:

fatal: [188.166.88.144]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '188.166.88.144' (ECDSA) to the list of known hosts.\r\nPermission denied (publickey).\r\n", "unreachable": true}

but

ssh root@188.166.88.144 -i configs/algo.pem

works well - i connect to server

jackivanov commented 7 years ago

@lgg Try this