I have a python utility with which I have been successfully managing our /etc/smbpasswd and /etc/samba/smbpasswd files for over 12 years. Time to update it to Python 3 !
I found that the latest smbpasswd installs in Python3, but doesn't load.
What is the best way to solve this using smbpasswd compatibility? I am not looking at replacing the working system with tdbsam!
Even with the update of the package in 2011 python 3 had been out for a few years, so I assumed it is dead code.
There is an easy solution, install passlib with pip and create a file smbpasswd.py file with the following content:
import passlib.hash
def lmhash(s):
return passlib.hash.lmhash.encrypt(s).upper()
def nthash(s):
return passlib.hash.nthash.encrypt(s).upper()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With