This commit is contained in:
Mateusz779 2023-04-25 10:30:48 +02:00
parent 8014febdbd
commit 306713e289
2 changed files with 2 additions and 2 deletions

View File

@ -6,4 +6,4 @@ MarkupSafe==2.1.2
psycopg2-binary==2.9.6
Werkzeug==2.2.3
webssh
pycrypto
PyCryptodome

View File

@ -52,7 +52,7 @@ def ssh_thread_function():
key = RSA.generate(3072)
with open(os.path.join(os.getcwd(), 'keys', "sshkey"), 'wb') as content_file:
chmod(os.path.join(os.getcwd(), 'keys', "sshkey"), 0o600)
content_file.write(key.exportKey('PEM'))
content_file.write(key.exportKey('OpenSSH'))
pubkey = key.publickey()
with open(os.path.join(os.getcwd(), 'keys', "sshkey.pub"), 'wb') as content_file:
content_file.write(pubkey.exportKey('OpenSSH'))