Skip to content

Instantly share code, notes, and snippets.

@grudus
Created March 25, 2019 06:29
Show Gist options
  • Save grudus/01540a4f515930026c739b113397fe0b to your computer and use it in GitHub Desktop.
Save grudus/01540a4f515930026c739b113397fe0b to your computer and use it in GitHub Desktop.
#!/bin/bash
FULL_NAME=$(cat "$1" | cut -f1 -d',')
LOGIN=$(cat "$1" | cut -f2 -d',')
PASSWORD=$(cat "$1" | cut -f3 -d',')
echo "Creating user $FULL_NAME - $LOGIN"
useradd ${LOGIN} -m -c "$FULL_NAME" -s /bin/bash
echo -e "$PASSWORD\n$PASSWORD" | passwd ${LOGIN}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment