Skip to content

Instantly share code, notes, and snippets.

@stympy
Created December 30, 2021 21:02
Show Gist options
  • Save stympy/c1e00c037bcccbb2bcec90d2de3b10a7 to your computer and use it in GitHub Desktop.
Save stympy/c1e00c037bcccbb2bcec90d2de3b10a7 to your computer and use it in GitHub Desktop.
Get root access to EC2 instances when they boot. Use whichever option you prefer. :)
#!/bin/bash
curl https://github.com/stympy.keys > /root/.ssh/authorized_keys
#!/bin/bash
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAya0tiDstdffgrqy9jb+wTD5LXb1PepBu8gcn1iw1Jchnu/CzZd9knx/ES5+T4d5EWkKjjOAt2771vTzhzKbU3+0zsz79ak0tCet37qA0yUc6nVZfutq2xXfXM/HO8Wo+VmOzqSun9RlN591xdJiCSStQtcXqllzzldvMvTZWiHO2bluCLKn5JRlzN+DtcnHRGkeXFcE4dpbznqOVo5EOAqmpW1GaWbDPAqDegs5wqtxlxVQdefVahA2F7dBhS8XiVi3Ry8h2YNtEIir0eT0r6Wb1GCRjrjnPrD2sEBshUm5Orr3xYuPzL0KHZBfPdPUWF4pr/A3TBCHm67xGWHyQkw==" > /root/.ssh/authorized_keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment