dodanie kluczy ssh
This commit is contained in:
parent
42acfa57e3
commit
6888472940
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,4 +2,5 @@
|
|||||||
/venv
|
/venv
|
||||||
/configs/squash
|
/configs/squash
|
||||||
/squash
|
/squash
|
||||||
|
/keys
|
||||||
|
|
||||||
|
14
utils.py
14
utils.py
@ -11,8 +11,8 @@ import db
|
|||||||
import config
|
import config
|
||||||
import ipaddress
|
import ipaddress
|
||||||
|
|
||||||
DELETE_TIMEOUT=30
|
DELETE_TIMEOUT = 30
|
||||||
RESTART_DELETE_THREAD=10
|
RESTART_DELETE_THREAD = 10
|
||||||
|
|
||||||
|
|
||||||
def generate_random_string(length):
|
def generate_random_string(length):
|
||||||
@ -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():
|
||||||
|
Loading…
Reference in New Issue
Block a user