title: Docker-machine can't use userdata add key to ssh cloud image
body: <ul>
  <li>My provider : OpenStack</li>
  <li>VM OS: Ubuntu 16.04</li>
  <li>Docker-machine Version: 0.14.0</li>
  <li>Problem: 
  
  <ul>
  <li>I want to use userdata add another public key to authorized_keys, 
  using --openstack-user-data-file option to specify my userdata.yml.</li>
  </ul></li>
  </ul>
  
  <p>Here is my userdata.yml:</p>
  
  <p><code>#cloud-config
  users:
    - default
    - name: ubuntu
      groups: sudo
      shell: /bin/bash
      sudo: ['ALL=(ALL) NOPASSWD:ALL']
      ssh-authorized-keys:
        - ssh-rsa XXXXXXXXXXXXXX
  </code>
  Use docker-machine command to create vm:
  <code>
  docker-machine --debug create --driver openstack 
  --openstack-auth-url http://x.x.x.x:5001/v3 
  --openstack-domain-id defaule
   --openstack-endpoint-type adminURL 
  --openstack-floatingip-pool ext-net 
  --openstack-keypair-name mykey
  --openstack-flavor-id 4 
  --openstack-image-name ubuntu-16.04-cloud 
  --openstack-net-name private 
  --openstack-password XXXXX 
  --openstack-private-key-file /home/demo/id_rsa
  --openstack-sec-groups default 
  --openstack-ssh-user ubuntu
  --openstack-tenant-name admin
  --openstack-user-data-file /home/demo/userdata.yml 
  --openstack-username admin 
  vm
  </code>
  After creating vm , docker-machine stuck " waiting for ssh to be available".
  Here is debug output:
  <code>
  Getting to WaitForSSH function...
  (vm) Calling .GetSSHHostname
  (vm) Calling .GetSSHPort
  (vm) Calling .GetSSHKeyPath
  (vm) Calling .GetSSHKeyPath
  (vm) Calling .GetSSHUsername
  Using SSH client type: external
  Using SSH private key: /root/.docker/machine/machines/vm/id_rsa (-rw-------)
  &amp;{[-F /dev/null -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none ubuntu@10.50.2.36 -o IdentitiesOnly=yes -i /root/.docker/machine/machines/vm/id_rsa -p 22] /usr/bin/ssh &lt;nil&gt;}
  About to run SSH command:
  exit 0
  SSH cmd err, output: exit status 255: 
  Error getting ssh command 'exit 0' : ssh command error:
  command : exit 0
  err     : exit status 255
  output  :
  </code></p>
  
  <p>I try to ssh to vm by command:
  <code>ssh -i /root/.docker/machine/machines/vm/id_rsa ubuntu@10.50.2.36</code></p>
  
  <p>But got error message: 
  <code>Permission denied (publickey).</code></p>
  
  <p>So, I try another key , the key was in option of --openstack-private-key-file  /home/demo/id_rsa</p>
  
  <p><code>ssh -i  /home/demo/id_rsa ubuntu@10.50.2.36</code></p>
  
  <p>ssh was successful!</p>
  
  <p>I checked two keys,  <strong>/root/.docker/machine/machines/vm/id_rsa</strong> and <strong>/home/demo/id_rsa,</strong>
  but two keys are the same.</p>
  
  <p>I was confused,  why the same keys, one can ssh another one can't ssh? </p>