Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- KALI,APPLE,10/20/75,Year 1
- STEV,BAR,06/18/75,Year 2
- DEREK,BEN,11/12/70,Year 1
- FIDE,CAST,07/04/77,Year 2
- #!bin/bash
- echo -e "This is a shell script for Assignment02.n"
- # A ssign file descriptors to username file
- exec 3< username.txt
- # Read user and password
- while read iuser <&3 && read ipasswd <&3; do
- # Print it here
- printf "tCreating user: %s with password: %sn" $iuser $ipasswd
- # Create the user with adduser
- useradd -m -s /bin/flase $iuser
- # Assign the password to the user
- passwd "$iuser" <<<"ipasswd"$'n'"$ipasswd"
- done
Add Comment
Please, Sign In to add comment