Add a comment about password hashing in adduser

This commit is contained in:
Anthony Wang 2023-05-29 00:04:50 +00:00
parent 97e60b232d
commit 6b4e580c40
Signed by: a
GPG key ID: 42A5B952E6DD8D38

View file

@ -21,6 +21,7 @@ def adduser(username, firstname, lastname, email, password):
else:
fullname = f'{firstname} {lastname}'
# Generate password hash using OpenSSL
with open('password', 'w') as f:
f.write(password)
hashed_password = check_output(['openssl', 'passwd', '-6', '-in', 'password']).decode('utf-8')[:-1]