Skip to content
Permalink
Browse files

Change AWS user account

  • Loading branch information...
NEMS Linux
NEMS Linux committed Aug 24, 2019
1 parent 08138bf commit b1202d757609f0d4a2ffeb2d21593650ba208900
Showing with 12 additions and 0 deletions.
  1. +12 −0 build/030-user
@@ -1,5 +1,6 @@
#!/bin/bash
echo $0 > /var/www/html/userfiles/nems-build.cur
platform=$(/usr/local/bin/nems-info platform)

# Create nemsadmin user
adduser --disabled-password --gecos "" nemsadmin
@@ -19,6 +20,16 @@ echo $0 > /var/www/html/userfiles/nems-build.cur
cp /root/nems/nems-migrator/data/nems/changelog.txt .


# Amazon Web Services uses a key pair instead of password
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/
fi
fi

# Delete any default users and remove their home folders
userdel -f -r baldnerd # Bald Nerd's Base Images
userdel -f -r pi
@@ -29,6 +40,7 @@ echo $0 > /var/www/html/userfiles/nems-build.cur
userdel -f -r dietpi
userdel -f -r pine # Pine A64+
userdel -f -r pine64 # Sopine
userdel -f -r admin # Amazon Web Services

# Remove sudo message
echo "Defaults lecture = never" > /etc/sudoers.d/privacy

0 comments on commit b1202d7

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