Today I Learned: 20/04/2023 - using NTLM on Ubuntu 22.04 with pywinrm
Publish date: 20 Apr 2023
On a newly installed Ubuntu 22.04, the pywinrm-based Python code that worked correctly on my previous laptop gave me an error, which boiled down to the Python hashlib module not being able to use the MD4 hash. This stackoverflow post was very helpful in fixing it on my system. I effectively added legacy support to my openssl configuration, by editing my /etc/ssl/openssl.cnf file to make these changes:
- In the existing [provider_sect] section, I added this line:
legacy = legacy_sect
- In the existing [default_sect] section, I uncommented this line:
#activate = 1
- I added this section to the end of the file:
[legacy_sect]
activate = 1
This changes were sufficient to get my code working as before.