mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-02 07:07:18 -04:00
Improve method of serving whitelist contents to clients
This commit is contained in:
+3
-3
@@ -193,9 +193,9 @@ def whitelist_verify(_port, _username_ssh, _ip, _client_device_id, _identity):
|
|||||||
except CalledProcessError:
|
except CalledProcessError:
|
||||||
_i, _full_password = 0, ''
|
_i, _full_password = 0, ''
|
||||||
_server_whitelist = run(('ssh', '-i', _identity, '-p', _port, f"{_username_ssh}@{_ip}",
|
_server_whitelist = run(('ssh', '-i', _identity, '-p', _port, f"{_username_ssh}@{_ip}",
|
||||||
f'python3 -c \'from os import listdir; print(listdir("/home/{_username_ssh}'
|
'python3 -c \'from os import listdir; [print(_id, end="\x1f") for _id in '
|
||||||
f'/.config/sshyp/whitelist"))\''),
|
f'listdir("/home/{_username_ssh}/.config/sshyp/whitelist")]\''),
|
||||||
stdout=PIPE, text=True).stdout.rstrip()[2:-2].split("', '")
|
stdout=PIPE, text=True).stdout.rstrip().split('\x1f')
|
||||||
for _device_id in _server_whitelist:
|
for _device_id in _server_whitelist:
|
||||||
if _device_id == _client_device_id:
|
if _device_id == _client_device_id:
|
||||||
from getpass import getpass
|
from getpass import getpass
|
||||||
|
|||||||
Reference in New Issue
Block a user