Skip to content

Instantly share code, notes, and snippets.

@jacqueswww
Last active November 19, 2015 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacqueswww/2ab396611b29584a40c0 to your computer and use it in GitHub Desktop.
Save jacqueswww/2ab396611b29584a40c0 to your computer and use it in GitHub Desktop.
Ansible bootstrap
#!/bin/bash
# bootstrap a container to accept ansible.
key_location="https://github.com/jacqueswww.keys"
sudo apt-get install -y curl python
sudo mkdir /root/.ssh/
sudo chmod 600 /root/.ssh/
sudo curl $key_location > /root/.ssh/authorized_keys
sudo echo "ListenAddress 0.0.0.0" >> /etc/ssh/sshd_config
sudo sed -i /etc/ssh/sshd_config -e 's/PermitRootLogin without-password/PermitRootLogin yes/'
sudo service ssh restart
@jacqueswww
Copy link
Author

@jacqueswww
Copy link
Author

sudo apt-get install -y wget && wget git.io/v4K74 -O - | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment