instantlinux/docker-tools

ProFTPD: Cannot create Hash

Closed this issue · 1 comments

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?

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)])))