pachadotdev / analogsea

Digital Ocean R client
https://pacha.dev/analogsea/
Apache License 2.0
154 stars 24 forks source link

Default user should be recorded in droplet object #86

Closed wch closed 9 years ago

wch commented 9 years ago

When a droplet is created with cloud_config='ubuntu', you can only log in as user analogsea, not root.

I think the droplet object should record this user and use it by default.

Edit: in order for droplets() or droplet() to return this information, we'll need to retrieve the user-data metadata: https://www.digitalocean.com/community/tutorials/an-introduction-to-droplet-metadata

hadley commented 9 years ago

There's no way to record that information on the droplet. The plan is to make cloud_config the default, and then change the default user to analogsea.

wch commented 9 years ago

You can get it when you're logged into droplet, using the metadata API: https://developers.digitalocean.com/metadata/#user-data

For example:

analogsea@revdep:~$ curl http://169.254.169.254/metadata/v1/user-data
#cloud-config
users:
- name: analogsea
  sudo: ALL=(ALL) NOPASSWD:ALL
  groups: sudo
  shell: /bin/bash
 ....

... but of course the problem with ssh'ing in and running this query is that you need to know who to ssh in as first.