cloud-sandbox is a program that launches a cloud instance (EC2 by default), automatically generates ssh
host keys, ssh's into the launched system, and prompts the user for instance termination on exit.
cloud-sandbox does the following:
- conveniently supports simple parameters for instance-type and ubuntu-release, by passing those to
ubuntu-ec2-run(1)
-generatesssh-hostkeyslocallyusingssh-keygen(1),andpassesthemtotheinstance-automaticallyaddshostkeyfingerprintstoalocalhostkeysfile,$HOME/.ssh/known_hosts.cloud,whichremovestheinteractivefingerprintprompt-usesssh-import-id(1)intheinstancetoimporttheuser'spublicSSHkey,iftheenvironmentvariable$LAUNCHPAD_IDexists-usesbootmail(1)tosendtheuseremailnotingthattheinstancehasbooted,iftheenvironmentvariable$BOOTMAILexistsandisavalidemailaddress-waitsinaloopforsshd(8)tostartonthecloudinstance-execsanssh(1)sessiontotheinstance-uponexit,interactivelypromptstheuseriftheywanttoimmediatelyterminatetheinstanceandremotethesshknownhostkey