Created
October 14, 2023 11:13
-
-
Save martinkennelly/6e05502b68bec40bd8970b02eb5278de to your computer and use it in GitHub Desktop.
setup non-root user with passwordless root
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
# Setup user group and user and ensure passwordless root | |
groupadd mk && useradd --gid mk --groups mk,users,adm --shell /bin/bash -c "mk home" --create-home mk | |
cat <<EOT >> /etc/sudoers.d/99-mk | |
mk ALL=(ALL) NOPASSWD:ALL | |
EOT | |
# Create new .ssh dir in mk home dir and add a public key to authorized_key file and set perms | |
chmod 400 authorized_key | |
chown -R mk:mk ~mk/.ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment