Skip to content

Instantly share code, notes, and snippets.

@aleozlx
Last active November 20, 2018 08:01
Show Gist options
  • Select an option

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

Select an option

Save aleozlx/9464d2bd5713115e00302279aed342b8 to your computer and use it in GitHub Desktop.
# yum -y install sudo
ME=ansible
useradd ${ME}
mkdir -p "/home/${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"
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