Skip to content

Instantly share code, notes, and snippets.

@aleozlx
Last active December 13, 2018 00:36
Show Gist options
  • Select an option

  • Save aleozlx/fc468bec8a31ef7c4f9bf0605e52f74c to your computer and use it in GitHub Desktop.

Select an option

Save aleozlx/fc468bec8a31ef7c4f9bf0605e52f74c to your computer and use it in GitHub Desktop.
Authorize myself into machines
ME=aleozlx
useradd ${ME}
echo "${ME} All=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/${ME}"
mkdir -pv "/home/${ME}/.ssh"
echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIxMOh1s9+bMx+BrsZ9gnvUeMXfTYP2pYM96weaZ+GUl alex@ansible.3cv-research.com' >> "/home/${ME}/.ssh/authorized_keys"
echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH28Ycjjv1L+BVsycPK/gTittc3Xv9ENpAOPfkfM20dy alex@latitude-5289' >> "/home/${ME}/.ssh/authorized_keys"
chown -R ${ME}:${ME} "/home/${ME}"
chmod 700 "/home/${ME}/.ssh"
chmod 600 "/home/${ME}/.ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment