This bash shell script is useful for creating a new user and setting a password for that user. This allows you to just type a username and password and everything else is done for you. Very useful for someone who is in a hurry.
#!/bin/bash echo "Type a username for your new account: " read username echo "Type a password for your new account: " read password # Creating our new account. useradd -m -s /bin/bash -d /home/$username $username # Setting a hashed password for our new user. echo "$username:$password" | chpasswd echo Username: $username echo Password: $password |
Give this script a try and see what you think of this. I will make improvements to this script and put it on githb when I get the chance.