Skip to content

Instantly share code, notes, and snippets.

@x2c3z4
Created October 31, 2016 09:28
Show Gist options
  • Save x2c3z4/69cb01ae89b6f567afc5099990cd2e9b to your computer and use it in GitHub Desktop.
Save x2c3z4/69cb01ae89b6f567afc5099990cd2e9b to your computer and use it in GitHub Desktop.
for username in a b c;do
useradd -d /home/${username} -m ${username} -s /bin/bash
pass=`echo $username | rev`
echo -e "$pass\n$pass" | passwd ${username}
echo "${username} ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/${username}
sudo chmod 0440 /etc/sudoers.d/${username}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment