Skip to content

Instantly share code, notes, and snippets.

@bitsandbooks
Last active March 3, 2018 22:50
Show Gist options
  • Save bitsandbooks/a4a630fe91546f44a18404ad4453d4d2 to your computer and use it in GitHub Desktop.
Save bitsandbooks/a4a630fe91546f44a18404ad4453d4d2 to your computer and use it in GitHub Desktop.
#cloud-config
groups:
- foo
users:
- default # use the default users/groups that come with this o.s.
- name: bar # create a user named bar
gecos: Bar User # comment field. use for full name, room number, etc.
primary-group: foo # set bar's primary group to foo
groups: sudo # also add bar to the sudo group
no-user-group: true # don't create a user group for bar
passwd:
# generate a password hash by running
# `mkpasswd --method=sha-512 --rounds=4096`
# and paste the result in the field above
shell: /bin/bash # safe default
ssh-authorized-keys:
-
# generate an ssh key with
# `ssh-keygen -t rsa -b 4096 -C "Bar's SSH Key" -f ~/.ssh/bar_key_rsa`
# give it a strong password, then copy & paste the contents of
# ~/.ssh/bar_key_rsa.pub in the field above (next to the dash)
sudo: ['ALL=(ALL) NOPASSWD:ALL'] # allow bar to use sudo without
# requiring a password
# USE WITH CAUTION!
# upgrade all packages on the system on first boot
# note: by default, package index is refreshed automatically upon first boot
package_upgrade: true
# install packages
# note: not intended for full provisioning. only add what is necessary to
# bootstrap other provisioning software (e.g., ansible)
packages:
- python
- python-apt
# use datasource for cloud provider
datasource:
DigitalOcean:
retries: 3
timeout: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment