Skip to content

Commit

Permalink
Allow nemsadmin password login
Browse files Browse the repository at this point in the history
  • Loading branch information
NEMS Linux committed Aug 24, 2019
1 parent 36d435f commit a41c3b8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions platforms/aws/nemsadmin-pw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# AWS removes the nemsadmin password when the AMI is deployed. Reverse this action.

if [ -d /home/nemsadmin ]; then # the nemsadmin user folder exists
usercount=$(find /home/* -maxdepth 0 -type d | wc -l)
if (( $usercount == 1)); then # Only do this if there are no other users on the system
echo -e "nemsadmin\nnemsadmin" | passwd nemsadmin >/tmp/init 2>&1
fi
fi

0 comments on commit a41c3b8

Please sign in to comment.