Skip to content
Permalink
Browse files

Don't create admin user

  • Loading branch information...
NEMS Linux
NEMS Linux committed Aug 24, 2019
1 parent a3f5563 commit dfa5b30ed8bf383c07e1f09a8aa6798b2a08ba4f
Showing with 15 additions and 2 deletions.
  1. +6 −2 build/030-user
  2. +9 −0 notes/aws/aws.md
@@ -21,15 +21,19 @@ platform=$(/usr/local/bin/nems-info platform)


# Amazon Web Services uses a key pair instead of password
#if (( $platform == 22 )); then
if (( $platform == 22 )); then
# if [[ -e /home/admin/.ssh/authorized_keys ]]; then
# if [[ ! -e /home/nemsadmin/.ssh ]]; then
# mkdir /home/nemsadmin/.ssh
# fi
# cp /home/admin/.ssh/authorized_keys /home/nemsadmin/.ssh/
# chown nemsadmin:nemsadmin /home/nemsadmin/.ssh/authorized_keys
# fi
#fi
echo "#cloud-config
system_info:
default_user:
name: nemsadmin" > /etc/cloud/cloud.cfg.d/defaults.cfg
fi

# Delete any default users and remove their home folders
userdel -f -r baldnerd # Bald Nerd's Base Images
@@ -0,0 +1,9 @@
When creating the instance, add this to the user data field:

#cloud-config
system_info:
default_user:
name: nemsadmin


Boot once, then clean, shut down and create the AMI.

0 comments on commit dfa5b30

Please sign in to comment.
You can’t perform that action at this time.