Advertisement
codegazer

get_luks_pass

Jun 4th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #!/bin/python
  2.  
  3. # Name get_luks_pass
  4. # author codegazer
  5. # written 2019_06_03
  6. # Purpose Prompt user for LUKS encryption pass phrase. Loop until both match.
  7.  
  8. import sys
  9. import os
  10.  
  11. from getpass import getpass
  12.  
  13. print("LUKS encryption pass phrase: note once set this cannot be changed.")
  14. print("Do not forget the LUKS pass phrase. It cannot be recovered.")
  15. print("")
  16.  
  17. LUKSpass = "one"
  18. LUKSpass_again = "two"
  19.  
  20. while LUKSpass != LUKSpass_again :
  21.  
  22. LUKSpass = getpass("Please enter LUKS pass phrase for disk encryption: ")
  23. LUKSpass_again = getpass("Please enter LUKS pass phrase again: ")
  24.  
  25. if LUKSpass != LUKSpass_again :
  26. print("no match, try again")
  27. else :
  28. print("match OK")
  29. break # out of while loop
  30.  
  31. print("LUKS pass is: "+str(LUKspass))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement