Created
August 9, 2017 03:17
-
-
Save Pokom/ff0ceca5fdb82c2950eb203fa0314ccb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
# Configures a basic Ubuntu box. | |
# * Installs a few common packages | |
# * Disables root login | |
# * Disables password login | |
# * Creates a user in the sudo, www-data groups | |
# | |
# Follow the log by ssh-ing in and running: `tail -f /var/log/cloud-init-output.log` | |
apt_update: true | |
apt_upgrade: true | |
packages: | |
- language-pack-en | |
- build-essential | |
- curl | |
- g++ | |
- gcc | |
- git | |
- libssl-dev | |
- make | |
- openssl | |
users: | |
- name: app | |
groups: sudo | |
shell: /bin/bash | |
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | |
lock-passwd: true # no password login | |
ssh-authorized-keys: | |
- PUB_KEY | |
runcmd: | |
# Disable root ssh login and add our own new user: app | |
# Also add dokku user to support commands over SSH | |
- echo "Editing sshd_config" | |
- sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config | |
- sed -i -e '$aAllowUsers app dokku' /etc/ssh/sshd_config | |
- service ssh restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment