Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
initial commit of scripts
mchyzer committed May 28, 2020
1 parent e1f1d4e commit 4a1fb27
Showing 2 changed files with 31 additions and 0 deletions.
25 changes: 25 additions & 0 deletions internal/mkstudent.sh
@@ -0,0 +1,25 @@
#!/bin/bash

# Who am i?
MY_IP=$(curl icanhazip.com)

# Generate a password
PASS=$(od -An -N32 -i /dev/random | md5sum | cut -c1-8)
#ENCRYPTED_PASS=$(perl -e 'print crypt($ARGV[0], "password")' $PASS)

groupadd -g 1002 student

# Make the student account
#useradd -u 1002 -g 1002 -m -p $ENCRYPTED_PASS student

useradd -u 1002 -g 1002 -m student
echo "student:$PASS" | chpasswd

# Add the student account to docker group.
usermod -aG docker student

# Student uses sudo to become root.
#usermod -aG wheel student

# Echo the password
echo "$MY_IP, student, $PASS"
6 changes: 6 additions & 0 deletions internal/userdata.sh
@@ -0,0 +1,6 @@
#!/bin/bash
yum -y update
/root/mkstudent.sh
usermod -G wheel,docker student
docker pull rabbitmq:management
/home/student/start-rabbitmq.sh

0 comments on commit 4a1fb27

Please sign in to comment.