-
-
Save IsaiahByDayah/f42b8e8b9b1306e97e50f3ee4726f2b6 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 | |
users: | |
- name: isaiah | |
ssh_authorized_keys: | |
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFVM/7RnSK0BE4bK7/2KBP++phbD+CCqFdtb9kpkIPi [email protected]" | |
sudo: ALL=(ALL:ALL) ALL | |
groups: sudo | |
shell: /bin/bash | |
chpasswd: | |
expire: true | |
users: | |
- name: isaiah | |
password: changeme | |
type: text | |
runcmd: | |
- sed -i '/PermitRootLogin/d' /etc/ssh/sshd_config | |
- echo "PermitRootLogin without-password" >> /etc/ssh/sshd_config | |
- sed -i '/PubkeyAuthentication/d' /etc/ssh/sshd_config | |
- echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config | |
- sed -i '/PasswordAuthentication/d' /etc/ssh/sshd_config | |
- echo "PasswordAuthentication no" >> /etc/ssh/sshd_config | |
- systemctl restart ssh | |
- echo "\$nrconf{kernelhints} = -1;" > /etc/needrestart/conf.d/99disable-prompt.conf | |
- apt update | |
- apt upgrade -y --allow-downgrades --allow-remove-essential --allow-change-held-packages | |
- reboot |
Note
The first line #cloud-config
is important and required in order for things to be parsed correctly!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note
AFAIK this public ssh key is explicitly for my MacBook Pro 14in M1 Pro. Any other/additional computers would need their own ssh key added to access.