instantlinux / docker-tools

Docker tools for developer productivity & entertainment
Apache License 2.0
268 stars 90 forks source link

ProFTPD: Cannot create Hash #159

Closed TB1234 closed 2 months ago

TB1234 commented 2 months ago

I am not able to create a Hash for the ProFTPd Image:

import crypt,random,string; \
  print crypt.crypt('YOURPASSWORD', '\$6\$' + ''.join( \
[random.choice(string.ascii_letters + string.digits) \
  for _ in range(16)]))

throws an error:

Traceback (most recent call last):
  File "/tmp/main.py", line 2, in <module>
    import user_code
  File "/tmp/user_code.py", line 2
    print crypt.crypt('YOURPASSWORD', '\$6\$' + ''.join( \
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

[Execution complete with exit code 1]

How can I create a password hash for an own user?

TB1234 commented 2 months ago

OK, I can anser it myself... For python3 you need brackets...

import crypt,random,string; \
  print(crypt.crypt('YOURPASSWORD', '\$6\$' + ''.join( \
[random.choice(string.ascii_letters + string.digits) \
  for _ in range(16)])))