mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-28 04:46:34 -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:
|
||||
_i, _full_password = 0, ''
|
||||
_server_whitelist = run(('ssh', '-i', _identity, '-p', _port, f"{_username_ssh}@{_ip}",
|
||||
f'python3 -c \'from os import listdir; print(listdir("/home/{_username_ssh}'
|
||||
f'/.config/sshyp/whitelist"))\''),
|
||||
stdout=PIPE, text=True).stdout.rstrip()[2:-2].split("', '")
|
||||
'python3 -c \'from os import listdir; [print(_id, end="\x1f") for _id in '
|
||||
f'listdir("/home/{_username_ssh}/.config/sshyp/whitelist")]\''),
|
||||
stdout=PIPE, text=True).stdout.rstrip().split('\x1f')
|
||||
for _device_id in _server_whitelist:
|
||||
if _device_id == _client_device_id:
|
||||
from getpass import getpass
|
||||
|
||||
Reference in New Issue
Block a user