How to store and use DigitalOcean API KEY in command line script

hello all,

was trying to store, secure and use my DigitalOcean API Key for VM creation. this is what i had done.
it may not be the best but works for me. if you have better alternative, appreciate that you can share.

INSTRUCTION STEPS

Background:

  • i install VirtualBox on my Windows10 box
  • i am using ubunutu 14.04 as the VM to run docker-machine from
  1. install ccrypt

    apt-get install ccrypt

  2. create a file to store my API Key for DigitalOcean “myAPIkey” with a password

    ccrypt ./myAPIkey -e

  3. command i used to create mb VM in DigitalOcean

    /usr/local/bin# docker-machine create --driver digitalocean \

     --digitalocean-access-token=`ccrypt myAPIkey.cpt -d -c` test001
    

Enter decryption key: xxxxxxx
Running pre-create checks…
Creating machine…
:

but hang at “Machine is running, waiting for SSH to be available…”
:

1 Like

problem solved. some network issue here