Created
January 18, 2018 06:37
-
-
Save eumel8/e9d25ab3407a46b21ae576d75b1fac8b to your computer and use it in GitHub Desktop.
This file contains 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
Content-Type: multipart/mixed; boundary="===============8494485615320709508==" | |
MIME-Version: 1.0 | |
--===============8494485615320709508== | |
Content-Type: text/cloud-boothook; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename="boothook.sh" | |
#cloud-boothook | |
#!/bin/bash | |
--===============8494485615320709508== | |
Content-Type: text/cloud-config; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename="cloud-config.txt" | |
#cloud-config | |
# | |
# | |
# PLEASE LOOK AT URL FOR FULL EXAMPLE: | |
# | |
# https://github.com/cloudsigma/cloud-init/blob/master/doc/examples/cloud-config.txt | |
# https://github.com/cloudsigma/cloud-init/blob/master/doc/examples/ | |
# | |
hostname: console | |
fqdn: console.otx.example.com | |
packages: | |
- curl | |
- git | |
- python-jmespath | |
- python-netaddr | |
- python-openstackclient | |
- python-pip | |
- libs3-2 | |
- jq | |
- shellinabox | |
runcmd: | |
final_message: "The system is finally up, after $UPTIME seconds" | |
--===============8494485615320709508== | |
Content-Type: text/x-shellscript; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename="shellscript.sh" | |
#!/bin/bash | |
set -x | |
add-apt-repository -y ppa:ansible/ansible | |
apt-get update | |
apt-get -y install ansible | |
pip install python-otcclient | |
sed -i -e "s/^SHELLINABOX_PORT=4200/SHELLINABOX_PORT=443/" /etc/default/shellinabox | |
sed -i -e "s/^PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config | |
systemctl restart ssh.service | |
cat <<EOF > /var/lib/shellinabox/certificate-console.otx.example.com.pem | |
-----BEGIN CERTIFICATE----- | |
[put cert here] | |
-----END CERTIFICATE----- | |
-----BEGIN PRIVATE KEY----- | |
[put key here] | |
-----END PRIVATE KEY----- | |
EOF | |
systemctl restart shellinabox.service | |
useradd -m -s /bin/bash clouduser;echo clouduser:<password> | chpasswd -c SHA512 | |
--===============8494485615320709508==-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment