dodanie kluczy ssh

This commit is contained in:
Mateusz779 2023-04-25 09:58:40 +02:00
parent 42acfa57e3
commit 6888472940
2 changed files with 12 additions and 3 deletions

1
.gitignore vendored
View File

@ -2,4 +2,5 @@
/venv /venv
/configs/squash /configs/squash
/squash /squash
/keys

View File

@ -39,7 +39,15 @@ def ping_client(ip):
def ssh_thread_function(): def ssh_thread_function():
subprocess.run(['wssh', '--fbidhttp=False', '--port='+config.webssh_port]) try:
os.mkdir(os.path.join(os.getcwd(), 'keys'))
except:
pass
if os.path.exists(os.path.join(os.getcwd(), 'keys', "sshkey")) is False:
subprocess.run(['ssh-keygen ', '-t rsa ', '-f key', '-q', '-P ""'])
subprocess.run(['wssh', '--fbidhttp=False', '--port='+config.webssh_port,
'--hostfile='+os.path.join(os.getcwd(), 'keys', "sshkey")])
def check_allocation_thread_function(): def check_allocation_thread_function():