This commit is contained in:
Mateusz779 2023-04-25 10:36:42 +02:00
parent 306713e289
commit 92e3e6b0b5
2 changed files with 3 additions and 8 deletions

View File

@ -88,9 +88,9 @@ fi
mkdir /tmp/output/vpn/scripts mkdir /tmp/output/vpn/scripts
echo '#!/bin/bash echo '#!/bin/bash
printenv >> /tmp/starttap printenv >> /mnt/root/tmp/starttap
echo "$TAP" >> /tmp/starttap echo "$TAP" >> /mnt/root/tmp/starttap
ifconfig $TAP $ip netmask 255.255.255.0 up >> /tmp/starttap' > /tmp/output/vpn/scripts/starttap.sh ifconfig $TAP '$ip' netmask 255.255.255.0 up >> /mnt/root/tmp/starttap' > /tmp/output/vpn/scripts/starttap.sh
echo '#!/bin/bash echo '#!/bin/bash
printenv printenv

View File

@ -46,9 +46,6 @@ def ssh_thread_function():
except: except:
pass pass
if os.path.exists(os.path.join(os.getcwd(), 'keys', "sshkey")) is False: if os.path.exists(os.path.join(os.getcwd(), 'keys', "sshkey")) is False:
# process = subprocess.run(['ssh-keygen', '-t rsa', '-P ""', '-f ' +
# os.path.join(os.getcwd(), 'keys', "sshkey")])
# print(process.args)
key = RSA.generate(3072) key = RSA.generate(3072)
with open(os.path.join(os.getcwd(), 'keys', "sshkey"), 'wb') as content_file: with open(os.path.join(os.getcwd(), 'keys', "sshkey"), 'wb') as content_file:
chmod(os.path.join(os.getcwd(), 'keys', "sshkey"), 0o600) chmod(os.path.join(os.getcwd(), 'keys', "sshkey"), 0o600)
@ -56,8 +53,6 @@ def ssh_thread_function():
pubkey = key.publickey() pubkey = key.publickey()
with open(os.path.join(os.getcwd(), 'keys', "sshkey.pub"), 'wb') as content_file: with open(os.path.join(os.getcwd(), 'keys', "sshkey.pub"), 'wb') as content_file:
content_file.write(pubkey.exportKey('OpenSSH')) content_file.write(pubkey.exportKey('OpenSSH'))
# while os.path.exists(os.path.join(os.getcwd(), 'keys', "sshkey")) is False:
# pass
subprocess.run(['wssh', '--fbidhttp=False', '--port='+config.webssh_port, subprocess.run(['wssh', '--fbidhttp=False', '--port='+config.webssh_port,
'--hostfile='+os.path.join(os.getcwd(), 'keys', "sshkey")]) '--hostfile='+os.path.join(os.getcwd(), 'keys', "sshkey")])