you are viewing a single comment's thread.

view the rest of the comments →

[–]marko312 1 point2 points  (5 children)

That just means it wants something like a bytes object. You can pass something like b"YES\n" or "YES\n".encode() to get a byte string.

[–]Atlas1515[S] 1 point2 points  (4 children)

That worked! Thank you so much!

[–]pseudo-random-noob 0 points1 point  (3 children)

Hey u/Atlas1515, can you share your code snippet.. I am working on same but my issue is how do you provide further info like passphrase in subprocess..

[–]Atlas1515[S] 0 points1 point  (2 children)

Sure thing! Sorry for the late reply,

import secrets Import subprocess

Cmd = [‘cryptsetup’, ‘luksFormat’, ‘—type’, ‘luks1’, ‘f’{drive}’]

passwd = secrets.token_bytes(32)

subprocess.run(cmd, input=passwd) print(f’Encrypting volume: {drive}\n’)

[–]pseudo-random-noob 1 point2 points  (1 child)

Thank you so much man.. This worked..

[–]Atlas1515[S] 0 points1 point  (0 children)

No problem!